]> granicus.if.org Git - rtmpdump/commitdiff
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 01decf9c2a5b2affdb3b4fec71d41efe0a6eb2e2..a8fa1283f835bc0ea1f40143256a930690b759c3 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);