mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +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->username = NULL;
|
||||||
url->password = NULL;
|
url->password = NULL;
|
||||||
|
|
||||||
|
/* file: URLs don't have credentials */
|
||||||
|
if (url->scheme_type == NSURL_SCHEME_FILE) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (length != 0 && *norm_start != ':') {
|
if (length != 0 && *norm_start != ':') {
|
||||||
char *sec_start = norm_start;
|
char *sec_start = norm_start;
|
||||||
if (pegs->colon_first != pegs->authority &&
|
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->host = NULL;
|
||||||
url->port = NULL;
|
url->port = NULL;
|
||||||
|
|
||||||
|
/* file: URLs don't have a host */
|
||||||
|
if (url->scheme_type == NSURL_SCHEME_FILE) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (length != 0) {
|
if (length != 0) {
|
||||||
size_t colon = 0;
|
size_t colon = 0;
|
||||||
char *sec_start = norm_start;
|
char *sec_start = norm_start;
|
||||||
|
Loading…
Reference in New Issue
Block a user