[FFmpeg-soc] [soc]: r4503 - rtmp/rtmpdec.c

kostya subversion at mplayerhq.hu
Tue Jun 23 19:53:15 CEST 2009


Author: kostya
Date: Tue Jun 23 19:53:15 2009
New Revision: 4503

Log:
strncpy() does not always put terminating byte, replace it with memcpy()

Modified:
   rtmp/rtmpdec.c

Modified: rtmp/rtmpdec.c
==============================================================================
--- rtmp/rtmpdec.c	Tue Jun 23 18:55:11 2009	(r4502)
+++ rtmp/rtmpdec.c	Tue Jun 23 19:53:15 2009	(r4503)
@@ -383,10 +383,12 @@ static int rtmp_read_header(AVFormatCont
             fname = strchr(p + 1, '/');
             if (!fname) {
                 fname = p + 1;
-                strncpy(app, path + 1, p - path - 1);
+                memcpy(app, path + 1, p - path - 1);
+                app[p - path - 1] = 0;
             } else {
                 fname++;
-                strncpy(app, path + 1, fname - path - 2);
+                memcpy(app, path + 1, fname - path - 2);
+                app[fname - path - 2] = 0;
             }
         }
     }


More information about the FFmpeg-soc mailing list