Increase tcUrl buffer size
authorHoward Chu <hyc@highlandsun.com>
Tue, 8 Nov 2011 10:04:01 +0000 (02:04 -0800)
committerHoward Chu <hyc@highlandsun.com>
Tue, 8 Nov 2011 10:04:01 +0000 (02:04 -0800)
rtmpdump.c

index 01decf9..a8fa128 100644 (file)
@@ -1152,9 +1152,9 @@ main(int argc, char **argv)
 
   if (tcUrl.av_len == 0)
     {
-      char str[512] = { 0 };
+      char str[1024];
 
-      tcUrl.av_len = snprintf(str, 511, "%s://%.*s:%d/%.*s",
+      tcUrl.av_len = snprintf(str, sizeof(str), "%s://%.*s:%d/%.*s",
                   RTMPProtocolStringsLower[protocol], hostname.av_len,
                   hostname.av_val, port, app.av_len, app.av_val);
       tcUrl.av_val = (char *) malloc(tcUrl.av_len + 1);