From 1b5b0eff9a9d058d6db88109c524c352e118d98f Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Tue, 26 Jan 2016 12:02:18 +0100 Subject: [PATCH] registrybackend: fix possible crash if cache_node is NULL --- gio/gregistrysettingsbackend.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gio/gregistrysettingsbackend.c b/gio/gregistrysettingsbackend.c index a37ffcc48..4a8c5844c 100644 --- a/gio/gregistrysettingsbackend.c +++ b/gio/gregistrysettingsbackend.c @@ -673,10 +673,12 @@ static gboolean registry_cache_update_node (GNode *cache_node, RegistryValue registry_value) { - RegistryCacheItem *cache_item = cache_node->data; + RegistryCacheItem *cache_item; g_return_val_if_fail (cache_node != NULL, FALSE); - g_return_val_if_fail (cache_item != NULL, FALSE); + g_return_val_if_fail (cache_node->data != NULL, FALSE); + + cache_item = cache_node->data; if (registry_value.type != cache_item->value.type) {