urlmon: File URIs can't have a userinfo component when creating an IUri using IUriBuilder.
This commit is contained in:
parent
f2a1737e35
commit
e767cc813d
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue