avformat/http: Fix Out-of-Bounds access in process_line()
authorWenxiang Qian <leonwxqian@qq.com>
Wed, 13 Feb 2019 07:54:08 +0000 (08:54 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 21 Mar 2019 09:42:52 +0000 (10:42 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 85f91ed760a517c0d5fcf692d40a5a9d7efa9476)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/http.c

index 4fdb2f1..954eee3 100644 (file)
@@ -915,7 +915,7 @@ static int process_line(URLContext *h, char *line, int line_count,
             while (av_isspace(*p))
                 p++;
             resource = p;
-            while (!av_isspace(*p))
+            while (*p && !av_isspace(*p))
                 p++;
             *(p++) = '\0';
             av_log(h, AV_LOG_TRACE, "Requested resource: %s\n", resource);