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

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


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

url: fix NULL dereference on invalid URI encoding

(cherry picked from commit 4b74cad9e29689d07bedb4ad197f714fa1384a82)

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

 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 44afaba3fa..83bba30e09 100644
--- a/src/text/url.c
+++ b/src/text/url.c
@@ -511,7 +511,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