]> git.sesse.net Git - vlc/commitdiff
url: fix out-of-bound read
authorRémi Denis-Courmont <remi@remlab.net>
Fri, 22 Aug 2014 20:04:39 +0000 (23:04 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Fri, 22 Aug 2014 20:05:25 +0000 (23:05 +0300)
...if *next is '\0'.

src/text/url.c

index 3492a54252088d638a65490f8ce7a35caf97c598..cd7e48819ed5548bdc1962c4beaef087dc4eaaf4 100644 (file)
@@ -412,7 +412,7 @@ void vlc_UrlParse (vlc_url_t *restrict url, const char *str, unsigned char opt)
     /* URL scheme */
     next = buf;
     while ((*next >= 'A' && *next <= 'Z') || (*next >= 'a' && *next <= 'z')
-        || (*next >= '0' && *next <= '9') || (strchr ("+-.", *next) != NULL))
+        || (*next >= '0' && *next <= '9') || memchr ("+-.", *next, 3) != NULL)
         next++;
     /* This is not strictly correct. In principles, the scheme is always
      * present in an absolute URL and followed by a colon. Depending on the