Commit e767cc81 authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

urlmon: File URIs can't have a userinfo component when creating an IUri using IUriBuilder.

parent f2a1737e
......@@ -5104,6 +5104,26 @@ static const uri_builder_test uri_builder_tests[] = {
0,INET_E_INVALID_URL,FALSE,
0,INET_E_INVALID_URL,FALSE,
0,0,0,INET_E_INVALID_URL,FALSE
},
/* File scheme's can't have a username set. */
{ "file://google.com/",0,S_OK,FALSE,
{
{TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
},
{FALSE},
0,INET_E_INVALID_URL,FALSE,
0,INET_E_INVALID_URL,FALSE,
0,0,0,INET_E_INVALID_URL,FALSE
},
/* File schemes can't have a password set. */
{ "file://google.com/",0,S_OK,FALSE,
{
{TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
},
{FALSE},
0,INET_E_INVALID_URL,FALSE,
0,INET_E_INVALID_URL,FALSE,
0,0,0,INET_E_INVALID_URL,FALSE
}
};
......
......@@ -3452,6 +3452,16 @@ static HRESULT validate_components(const UriBuilder *builder, parse_data *data,
if(FAILED(hr))
return hr;
/* Extra validation for file schemes. */
if(data->scheme_type == URL_SCHEME_FILE) {
if((builder->password || (builder->uri && builder->uri->userinfo_split > -1)) ||
(builder->username || (builder->uri && builder->uri->userinfo_start > -1))) {
TRACE("(%p %p %x): File schemes can't contain a username or password.\n",
builder, data, flags);
return INET_E_INVALID_URL;
}
}
return E_NOTIMPL;
}
......
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