From c95e0b3250cbe5144546dff53d9b5665988bcce4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 4 Sep 2016 15:43:11 -0400 Subject: Fix NULL predicate crash in lilv_world_find_nodes --- NEWS | 3 ++- src/world.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2441bec..db82cb9 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ lilv (0.22.1) unstable; * Add lilv_state_set_metadata() for adding state banks/comments/etc (based on patch from Hanspeter Portner) * Fix crash when state contains non-POD properties + * Fix crash when NULL predicate is passed to lilv_world_find_nodes() * Fix state file versioning * Unload contained resources when bundle is unloaded * Do not instantiate plugin when data fails to parse @@ -17,7 +18,7 @@ lilv (0.22.1) unstable; * Fix documentation installation * Fix outdated comment references to lilv_uri_to_path() - -- David Robillard Sat, 27 Aug 2016 09:14:39 -0400 + -- David Robillard Sun, 04 Sep 2016 15:43:02 -0400 lilv (0.22.0) stable; diff --git a/src/world.c b/src/world.c index 1e51a2d..8760604 100644 --- a/src/world.c +++ b/src/world.c @@ -193,6 +193,9 @@ lilv_world_find_nodes(LilvWorld* world, LILV_ERRORF("Subject `%s' is not a resource\n", sord_node_get_string(subject->node)); return NULL; + } else if (!predicate) { + LILV_ERROR("Missing required predicate\n"); + return NULL; } else if (!lilv_node_is_uri(predicate)) { LILV_ERRORF("Predicate `%s' is not a URI\n", sord_node_get_string(predicate->node)); -- cgit v1.2.1