From: Antoine Cellerier Date: Mon, 21 May 2007 20:37:23 +0000 (+0000) Subject: * include/vlc_url.h: vlc_UrlParse(): forbid use of '/' in login or password. Fixes... X-Git-Tag: 0.9.0-test0~7274 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=889362b53c52e8565b1e76b246f9667139b248ae;p=vlc * include/vlc_url.h: vlc_UrlParse(): forbid use of '/' in login or password. Fixes use of URLs like "http://www.lemonde.fr/web/video/0,47-0@2-3210,54-913109@51-891944,0.html". --- diff --git a/include/vlc_url.h b/include/vlc_url.h index 971cf34aad..b38bee2e19 100644 --- a/include/vlc_url.h +++ b/include/vlc_url.h @@ -63,6 +63,7 @@ static inline void vlc_UrlParse( vlc_url_t *url, const char *psz_url, char *psz_dup; char *psz_parse; char *p; + char *p2; url->psz_protocol = NULL; url->psz_username = NULL; @@ -108,7 +109,8 @@ static inline void vlc_UrlParse( vlc_url_t *url, const char *psz_url, psz_parse = p; } p = strchr( psz_parse, '@' ); - if( p != NULL ) + p2 = strchr( psz_parse, '/' ); + if( p != NULL && ( p2 != NULL ? p < p2 : 1 ) ) { /* We have a login */ url->psz_username = psz_parse;