From 889362b53c52e8565b1e76b246f9667139b248ae Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Mon, 21 May 2007 20:37:23 +0000 Subject: [PATCH] * 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". --- include/vlc_url.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.39.5