From 9dbdb8257e95a1f657dc043028a354ac17091875 Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Sat, 13 Jul 2019 16:03:47 +0200 Subject: [PATCH 1/3] Fix possible NULL dereference An error check was missing here. Thanks Coverity for pointing this out! --- src/as-cache.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/as-cache.c b/src/as-cache.c index 41f78a8b..50b42193 100644 --- a/src/as-cache.c +++ b/src/as-cache.c @@ -1589,6 +1589,11 @@ as_cache_register_addons_for_component (AsCache *cache, MDB_txn *txn, AsComponen return TRUE; addons = as_cache_components_by_hash_list (cache, txn, dval.mv_data, dval.mv_size, &tmp_error); + if (addons == NULL) { + g_propagate_error (error, tmp_error); + return FALSE; + } + for (guint i = 0; i < addons->len; i++) as_component_add_addon (cpt, AS_COMPONENT (g_ptr_array_index (addons, i))); -- 2.22.0