mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
nsurl: Don't allow credentials or host for file: URLs.
This commit is contained in:
parent
13a2ac7c08
commit
8e96e9bc27
@ -818,6 +818,11 @@ static nserror nsurl__create_from_section(const char * const url_s,
|
||||
url->username = NULL;
|
||||
url->password = NULL;
|
||||
|
||||
/* file: URLs don't have credentials */
|
||||
if (url->scheme_type == NSURL_SCHEME_FILE) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (length != 0 && *norm_start != ':') {
|
||||
char *sec_start = norm_start;
|
||||
if (pegs->colon_first != pegs->authority &&
|
||||
@ -854,6 +859,11 @@ static nserror nsurl__create_from_section(const char * const url_s,
|
||||
url->host = NULL;
|
||||
url->port = NULL;
|
||||
|
||||
/* file: URLs don't have a host */
|
||||
if (url->scheme_type == NSURL_SCHEME_FILE) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (length != 0) {
|
||||
size_t colon = 0;
|
||||
char *sec_start = norm_start;
|
||||
|
Loading…
Reference in New Issue
Block a user