]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/http.c
http: fix potentially dangerous whitespace skipping code
[ffmpeg] / libavformat / http.c
index 59f90ac603469b2b9884294b81b5a4b3e168026a..983034f0830f9832924e56326f4c4516755b654b 100644 (file)
@@ -760,6 +760,8 @@ static int parse_set_cookie(const char *set_cookie, AVDictionary **dict)
     back = &cstr[strlen(cstr)-1];
     while (strchr(WHITESPACES, *back)) {
         *back='\0';
+        if (back == cstr)
+            break;
         back--;
     }