]> git.sesse.net Git - ffmpeg/commitdiff
lavf/http: Fix parsing http request data to not read over '\0'.
authorStephan Holljes <klaxa1337@googlemail.com>
Thu, 20 Aug 2015 16:01:56 +0000 (18:01 +0200)
committerNicolas George <george@nsup.org>
Tue, 25 Aug 2015 17:51:13 +0000 (19:51 +0200)
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
libavformat/http.c

index 1eb716b1071eb560911e84d0a6803094d5435945..d3c0b7e659dd1921c1995822fb8661a9f8f5eea6 100644 (file)
@@ -714,7 +714,7 @@ static int process_line(URLContext *h, char *line, int line_count,
         if (s->is_connected_server) {
             // HTTP method
             method = p;
-            while (!av_isspace(*p))
+            while (*p && !av_isspace(*p))
                 p++;
             *(p++) = '\0';
             av_log(h, AV_LOG_TRACE, "Received method: %s\n", method);
@@ -751,7 +751,7 @@ static int process_line(URLContext *h, char *line, int line_count,
             while (av_isspace(*p))
                 p++;
             version = p;
-            while (!av_isspace(*p))
+            while (*p && !av_isspace(*p))
                 p++;
             *p = '\0';
             if (av_strncasecmp(version, "HTTP/", 5)) {