http: use av_strlcpy instead of strcpy() without size checks
authorJanne Grunau <janne-libav@jannau.net>
Tue, 9 Oct 2012 18:50:50 +0000 (20:50 +0200)
committerJanne Grunau <janne-libav@jannau.net>
Tue, 9 Oct 2012 19:05:14 +0000 (21:05 +0200)
Fixes CID700730.

libavformat/http.c

index 43c6cbc..9666ca3 100644 (file)
@@ -308,7 +308,7 @@ static int process_line(URLContext *h, char *line, int line_count,
         while (isspace(*p))
             p++;
         if (!av_strcasecmp(tag, "Location")) {
-            strcpy(s->location, p);
+            av_strlcpy(s->location, p, sizeof(s->location));
             *new_location = 1;
         } else if (!av_strcasecmp (tag, "Content-Length") && s->filesize == -1) {
             s->filesize = strtoll(p, NULL, 10);