mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-05-22 21:38:16 -04:00
uri: check 'scheme' is non-null before de-referencing it
This commit is contained in:
parent
98c84e6326
commit
43566b655f
1 changed files with 1 additions and 1 deletions
2
uri.c
2
uri.c
|
|
@ -144,7 +144,7 @@ uri_parse(const char *uri, size_t len,
|
||||||
const char *query_start = memchr(start, '?', left);
|
const char *query_start = memchr(start, '?', left);
|
||||||
const char *fragment_start = memchr(start, '#', left);
|
const char *fragment_start = memchr(start, '#', left);
|
||||||
|
|
||||||
if (streq(*scheme, "file")) {
|
if (scheme != NULL && streq(*scheme, "file")) {
|
||||||
/* Don't try to parse query/fragment in file URIs, just treat
|
/* Don't try to parse query/fragment in file URIs, just treat
|
||||||
the remaining text as path */
|
the remaining text as path */
|
||||||
query_start = NULL;
|
query_start = NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue