aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2026-05-11 11:37:53 +0000
committerDaniel Eklöf <daniel@ekloef.se>2026-05-11 11:37:53 +0000
commit43566b655fee76947e0166d74a9dda4c03be26e6 (patch)
tree2fe41948498929d69075424c510f37f0676da2b9
parentmeson: add -Dfanalyzer=false|true (diff)
uri: check 'scheme' is non-null before de-referencing it
-rw-r--r--uri.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uri.c b/uri.c
index e09f7a97..febe2e47 100644
--- a/uri.c
+++ b/uri.c
@@ -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;