[FFmpeg-cvslog] rtmpproto: Check the buffer sizes when copying app/playpath strings

Martin Storsjö git at videolan.org
Sun May 11 17:09:08 CEST 2014


ffmpeg | branch: release/2.2 | Martin Storsjö <martin at martin.st> | Thu May  8 15:12:23 2014 +0300| [7d97cc8d87ebf6ebe7ec1865d6f932c652dbce3a] | committer: Reinhard Tartler

rtmpproto: Check the buffer sizes when copying app/playpath strings

As pointed out by Reimar Döffinger.

CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 0bacfa8d37710b904897e7cbeb8d6f96fbf75e2e)

Conflicts:
	libavformat/rtmpproto.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d97cc8d87ebf6ebe7ec1865d6f932c652dbce3a
---

 libavformat/rtmpproto.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index bc6a4fe..ead5ccd 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2483,10 +2483,10 @@ reconnect:
             fname = strchr(p + 1, '/');
             if (!fname || (c && c < fname)) {
                 fname = p + 1;
-                av_strlcpy(rt->app, path + 1, p - path);
+                av_strlcpy(rt->app, path + 1, FFMIN(p - path, APP_MAX_LENGTH));
             } else {
                 fname++;
-                av_strlcpy(rt->app, path + 1, fname - path - 1);
+                av_strlcpy(rt->app, path + 1, FFMIN(fname - path - 1, APP_MAX_LENGTH));
             }
         }
     }



More information about the ffmpeg-cvslog mailing list