[vlc-commits] url: fix NULL dereference on invalid URI encoding

Rémi Denis-Courmont git at videolan.org
Wed Feb 20 16:36:06 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 20 17:21:44 2019 +0200| [3a34a20a6a796d8fb4c3bce2c92611fd0838fdd4] | committer: Rémi Denis-Courmont

url: fix NULL dereference on invalid URI encoding

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3a34a20a6a796d8fb4c3bce2c92611fd0838fdd4
---

 src/text/url.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/text/url.c b/src/text/url.c
index 3cfefb6aa1..cc83c16a68 100644
--- a/src/text/url.c
+++ b/src/text/url.c
@@ -512,7 +512,8 @@ static int vlc_UrlParseInner(vlc_url_t *restrict url, const char *str)
             if (next != NULL)
                 *(next++) = '\0';
 
-            url->psz_host = vlc_idna_to_ascii(vlc_uri_decode(cur));
+            const char *host = vlc_uri_decode(cur);
+            url->psz_host = (host != NULL) ? vlc_idna_to_ascii(host) : NULL;
         }
 
         if (url->psz_host == NULL)



More information about the vlc-commits mailing list