]> git.sesse.net Git - vlc/commitdiff
* include/vlc_url.h: vlc_UrlParse(): forbid use of '/' in login or password. Fixes...
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 21 May 2007 20:37:23 +0000 (20:37 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 21 May 2007 20:37:23 +0000 (20:37 +0000)
include/vlc_url.h

index 971cf34aad48f986bd46b37e58f1f6e4db6d1584..b38bee2e192efe1c88401fe7945deec841c9d682 100644 (file)
@@ -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;