uri: check 'scheme' is non-null before de-referencing it

This commit is contained in:
Daniel Eklöf 2026-05-11 13:37:53 +02:00
parent 98c84e6326
commit 43566b655f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
uri.c
View file

@ -144,7 +144,7 @@ uri_parse(const char *uri, size_t len,
const char *query_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
the remaining text as path */
query_start = NULL;