avformat/rtmpproto: add FFMIN() to av_strlcpy()
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 8 May 2014 16:19:38 +0000 (18:19 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 8 May 2014 16:19:38 +0000 (18:19 +0200)
Suggested-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtmpproto.c

index c8544ef..2883bb0 100644 (file)
@@ -2482,12 +2482,12 @@ reconnect:
     if (qmark && strstr(qmark, "slist=")) {
         char* amp;
         // After slist we have the playpath, before the params, the app
-        av_strlcpy(rt->app, path + 1, qmark - path);
+        av_strlcpy(rt->app, path + 1, FFMIN(qmark - path, APP_MAX_LENGTH));
         fname = strstr(path, "slist=") + 6;
         // Strip any further query parameters from fname
         amp = strchr(fname, '&');
         if (amp) {
-            av_strlcpy(fname_buffer, fname, amp - fname + 1);
+            av_strlcpy(fname_buffer, fname, FFMIN(amp - fname + 1, sizeof(fname_buffer)));
             fname = fname_buffer;
         }
     } else if (!strncmp(path, "/ondemand/", 10)) {