AppStream/0001-Fix-possible-NULL-dereference.patch
Christophe Giboudeaux 58c1118431 Accepting request 719783 from home:Vogtinator:boo1139463
- Add patches to fix crash with some invalid metainfo (boo#1139463):
  * 0001-Fix-possible-NULL-dereference.patch
  * 0002-Don-t-ignore-xmlNodeDump-return-code.patch
  * 0003-Fix-infinite-recursion-if-component-has-itself-liste.patch
- Update build requirements
- Add %check section

OBS-URL: https://build.opensuse.org/request/show/719783
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/AppStream?expand=0&rev=50
2019-07-30 08:48:39 +00:00

30 lines
905 B
Diff

From 9dbdb8257e95a1f657dc043028a354ac17091875 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
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