[rtmpdump] [PATCH] rtmpdump tcURL buffer too small
Robin Lewis
robin at robinlewis.com
Tue Nov 8 00:00:01 CET 2011
Hi
I found an issue where rtmpdump failed because a fixed-size buffer for tcURL was too small. The particular problem instance could be resolved by doubling the hard-coded buffer size, but it would be better eventually to work out the required size and malloc the buffer.
I understand this issue has been noticed by others and discussed elsewhere (e.g. stream-recorder.com/forum/specify-tcurl-rtmpdump-might-not-work-t10355.html)
My proposed basic patch is therefore:
diff --git a/rtmpdump/rtmpdump.c b/rtmpdump/rtmpdump.c
index 01decf9..e06fe85 100644
--- a/rtmpdump/rtmpdump.c
+++ b/rtmpdump/rtmpdump.c
@@ -1152,9 +1152,9 @@ main(int argc, char **argv)
if (tcUrl.av_len == 0)
{
- char str[512] = { 0 };
+ char str[1024] = { 0 };
- tcUrl.av_len = snprintf(str, 511, "%s://%.*s:%d/%.*s",
+ tcUrl.av_len = snprintf(str, 1023, "%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);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20111107/33d2c79b/attachment.html>
More information about the rtmpdump
mailing list