aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-12-18 15:30:31 -0500
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:59 +0100
commitb6b777a0c0145449bce9855bc3851ad1b5edf409 (patch)
treecf45878aa51a82f89c39c7f48cb9a34aad454150
parentb187e0541e9ac422168fc436429e79fbe70de7a7 (diff)
downloadserd-b6b777a0c0145449bce9855bc3851ad1b5edf409.tar.gz
serd-b6b777a0c0145449bce9855bc3851ad1b5edf409.tar.bz2
serd-b6b777a0c0145449bce9855bc3851ad1b5edf409.zip
Fix crash when expanding empty URI prefixes
-rw-r--r--src/env.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/env.c b/src/env.c
index a9753069..5cbb6a43 100644
--- a/src/env.c
+++ b/src/env.c
@@ -281,7 +281,7 @@ serd_env_expand_in_place(const SerdEnv* env,
const SerdPrefix* const prefix = serd_env_find(env, str, name_len);
if (prefix) {
uri_prefix->buf = serd_node_string(prefix->uri);
- uri_prefix->len = prefix->uri->n_bytes;
+ uri_prefix->len = prefix->uri ? prefix->uri->n_bytes : 0;
uri_suffix->buf = colon + 1;
uri_suffix->len = curie->n_bytes - name_len - 1;
return SERD_SUCCESS;