From 24eb3c791606fe98a1591c13a8b2ba6c342bb3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 17 Jan 2014 14:29:57 +0200 Subject: [PATCH] rtmpproto: Avoid using uninitialized memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the url ends with .flv, we stripped it but didn't initialize rt->playpath, doing av_strlcat on an uninitialized buffer. Signed-off-by: Martin Storsjö --- libavformat/rtmpproto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 135af82daa..51381a4d0c 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2510,9 +2510,9 @@ reconnect: (!strcmp(fname + len - 4, ".f4v") || !strcmp(fname + len - 4, ".mp4"))) { memcpy(rt->playpath, "mp4:", 5); - } else if (len >= 4 && !strcmp(fname + len - 4, ".flv")) { - fname[len - 4] = '\0'; } else { + if (len >= 4 && !strcmp(fname + len - 4, ".flv")) + fname[len - 4] = '\0'; rt->playpath[0] = 0; } av_strlcat(rt->playpath, fname, PLAYPATH_MAX_LENGTH);