aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Holljes <klaxa1337@googlemail.com>2015-08-20 18:01:56 +0200
committerNicolas George <george@nsup.org>2015-08-25 19:51:13 +0200
commit4f860848abf1c6fedc6656acab8b34e424c289f0 (patch)
tree2236b16aa7739f11113edffede02de896d62fa72
parent94a4be85a1fcd57fdfd45dc291813d6afef8a87b (diff)
downloadffmpeg-4f860848abf1c6fedc6656acab8b34e424c289f0.tar.gz
lavf/http: Fix parsing http request data to not read over '\0'.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
-rw-r--r--libavformat/http.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 1eb716b107..d3c0b7e659 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -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)) {