Commit 2bbfeddf authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

http: Fix a NULL ptr deref in http-user-agent handling.

parent a1299460
...@@ -340,11 +340,14 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access, ...@@ -340,11 +340,14 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
/* Determine the HTTP user agent */ /* Determine the HTTP user agent */
/* See RFC2616 §2.2 token definition and §3.8 user-agent header */ /* See RFC2616 §2.2 token definition and §3.8 user-agent header */
p_sys->psz_user_agent = var_InheritString( p_access, "http-user-agent" ); p_sys->psz_user_agent = var_InheritString( p_access, "http-user-agent" );
for( char *p = p_sys->psz_user_agent; *p; p++ ) if (p_sys->psz_user_agent)
{ {
uint8_t c = *p; for( char *p = p_sys->psz_user_agent; *p; p++ )
if( c < 32 || strchr( "()<>@,;:\\\"[]?={}", c ) ) {
*p = '_'; /* remove potentially harmful characters */ uint8_t c = *p;
if( c < 32 || strchr( "()<>@,;:\\\"[]?={}", c ) )
*p = '_'; /* remove potentially harmful characters */
}
} }
/* Check proxy */ /* Check proxy */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment