1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

lavf/http: Fix parsing http request data to not read over '\0'.

Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
This commit is contained in:
Stephan Holljes
2015-08-20 18:01:56 +02:00
committed by Nicolas George
parent 94a4be85a1
commit 4f860848ab

View File

@@ -714,7 +714,7 @@ static int process_line(URLContext *h, char *line, int line_count,
if (s->is_connected_server) { if (s->is_connected_server) {
// HTTP method // HTTP method
method = p; method = p;
while (!av_isspace(*p)) while (*p && !av_isspace(*p))
p++; p++;
*(p++) = '\0'; *(p++) = '\0';
av_log(h, AV_LOG_TRACE, "Received method: %s\n", method); 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)) while (av_isspace(*p))
p++; p++;
version = p; version = p;
while (!av_isspace(*p)) while (*p && !av_isspace(*p))
p++; p++;
*p = '\0'; *p = '\0';
if (av_strncasecmp(version, "HTTP/", 5)) { if (av_strncasecmp(version, "HTTP/", 5)) {