diff -Nru libxmlb-0.1.8/debian/changelog libxmlb-0.1.8/debian/changelog --- libxmlb-0.1.8/debian/changelog 2020-06-09 19:21:18.000000000 +0200 +++ libxmlb-0.1.8/debian/changelog 2022-09-07 11:51:34.000000000 +0200 @@ -1,3 +1,9 @@ +libxmlb (0.1.8-1~ubuntu18.04.3) UNRELEASED; urgency=high + + * fix double-free bug. + + -- Sergio Costas Rodriguez Wed, 07 Sep 2022 11:51:34 +0200 + libxmlb (0.1.8-1~ubuntu18.04.2) bionic-security; urgency=medium * No changes rebuild diff -Nru libxmlb-0.1.8/debian/patches/fix-double-free-bug libxmlb-0.1.8/debian/patches/fix-double-free-bug --- libxmlb-0.1.8/debian/patches/fix-double-free-bug 1970-01-01 01:00:00.000000000 +0100 +++ libxmlb-0.1.8/debian/patches/fix-double-free-bug 2022-09-07 11:51:34.000000000 +0200 @@ -0,0 +1,45 @@ +Description: Fix double-free bug + Under some circumstances, depending on the specific data feeded to + libxmlb, a memory block can be freed twice during the final tree + prune, when the nodes with less priority are removed. + . + libxmlb (0.1.8-1~ubuntu18.04.3) UNRELEASED; urgency=high + . + * fix double-free bug. +Author: Sergio Costas Rodriguez +Applied-Upstream: https://github.com/hughsie/libxmlb/pull/127 +Bug-Ubuntu: https://bugs.launchpad.net/snap-store-desktop/+bug/1988440 + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2022-09-07 + +--- libxmlb-0.1.8.orig/src/xb-builder.c ++++ libxmlb-0.1.8/src/xb-builder.c +@@ -401,7 +401,7 @@ xb_builder_xml_lang_prio_cb (XbBuilderNo + for (guint i = 0; i < nodes->len; i++) { + XbBuilderNode *bn2 = g_ptr_array_index (nodes, i); + if (xb_builder_node_get_priority (bn2) < xb_builder_node_get_priority (bn_best)) +- g_ptr_array_add (nodes_to_destroy, bn2); ++ g_ptr_array_add (nodes_to_destroy, g_object_ref (bn2)); + + /* never visit this node again */ + xb_builder_node_set_priority (bn2, -2); +@@ -697,7 +697,7 @@ xb_builder_compile (XbBuilder *self, XbB + XbBuilderNodetabHelper nodetab_helper = { + .buf = NULL, + }; +- g_autoptr(GPtrArray) nodes_to_destroy = g_ptr_array_new (); ++ g_autoptr(GPtrArray) nodes_to_destroy = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref); + g_autoptr(GTimer) timer = g_timer_new (); + g_autoptr(XbBuilderCompileHelper) helper = NULL; + diff -Nru libxmlb-0.1.8/debian/patches/series libxmlb-0.1.8/debian/patches/series --- libxmlb-0.1.8/debian/patches/series 2019-05-09 16:55:53.000000000 +0200 +++ libxmlb-0.1.8/debian/patches/series 2022-09-07 11:51:34.000000000 +0200 @@ -1 +1,2 @@ old_meson_build.patch +fix-double-free-bug