From b6b777a0c0145449bce9855bc3851ad1b5edf409 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 18 Dec 2019 15:30:31 -0500 Subject: Fix crash when expanding empty URI prefixes --- src/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.1