Hello community,

here is the log from the commit of package appstream-glib for 
openSUSE:Leap:15.2 checked in at 2020-06-03 09:52:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/appstream-glib (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.appstream-glib.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "appstream-glib"

Wed Jun  3 09:52:26 2020 rev:24 rq: version:0.7.16

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/appstream-glib/appstream-glib.changes  
2020-03-06 12:36:18.446575939 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.appstream-glib.new.3606/appstream-glib.changes    
    2020-06-03 09:52:32.419331672 +0200
@@ -1,0 +2,5 @@
+Wed Jun  3 07:49:35 UTC 2020 - Yuchen Lin <[email protected]>
+
+- Add as-glib-PR359.patch: Fix crash with invalid children of <ul>.
+
+-------------------------------------------------------------------

New:
----
  as-glib-PR359.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ appstream-glib.spec ++++++
--- /var/tmp/diff_new_pack.RyhbTn/_old  2020-06-03 09:52:32.939332375 +0200
+++ /var/tmp/diff_new_pack.RyhbTn/_new  2020-06-03 09:52:32.939332375 +0200
@@ -26,6 +26,7 @@
 URL:            http://people.freedesktop.org/~hughsient/appstream-glib/
 Source0:        %{name}-%{version}.tar.xz
 Source1:        openSUSE-appstream-process
+Patch0:         as-glib-PR359.patch
 BuildRequires:  docbook-xsl-stylesheets
 BuildRequires:  gcab >= 0.6
 BuildRequires:  gobject-introspection-devel

++++++ as-glib-PR359.patch ++++++
>From d4bfa8389932029ae85a7bad4a762d69a47fbbb4 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <[email protected]>
Date: Wed, 22 Apr 2020 11:22:03 +0200
Subject: [PATCH] Fix crash with invalid children of <ul/>

It segfaulted when building the error message as data_c->name was invalid.
data_c was a valid tag, so only the data_c->tag union member was active.
Fix the crash by calling the proper function instead and add a test case.
---
 libappstream-glib/as-node.c      |  2 +-
 libappstream-glib/as-self-test.c | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c
index 7fd68515..66d582a8 100644
--- a/libappstream-glib/as-node.c
+++ b/libappstream-glib/as-node.c
@@ -1891,7 +1891,7 @@ as_node_get_localized_unwrap_type_li (const AsNode *node,
                                                     AS_NODE_ERROR,
                                                     
AS_NODE_ERROR_INVALID_MARKUP,
                                                     "Tag %s in %s invalid",
-                                                    data_c->name,
+                                                    as_tag_data_get_name 
(data_c),
                                                     as_tag_data_get_name 
(data));
                                        return FALSE;
                                }
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index 47ad937f..66166410 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -2810,6 +2810,7 @@ as_test_node_xml_func (void)
        AsNode *n2;
        AsNode *root;
        GString *xml;
+       GHashTable *hashtable;
 
        /* invalid XML */
        root = as_node_from_xml ("<moo>", 0, &error);
@@ -2920,6 +2921,16 @@ as_test_node_xml_func (void)
        g_assert_cmpstr (xml->str, ==, "<!-- 1st -->\n<!-- 2nd -->\n<foo/>\n");
        g_string_free (xml, TRUE);
        as_node_unref (root);
+
+       /* invalid child of ul */
+       root = as_node_from_xml ("<ul><ul></ul></ul>", 0, &error);
+       g_assert_no_error (error);
+       g_assert (root != NULL);
+       hashtable = as_node_get_localized_unwrap (root, &error);
+       g_assert_error (error, AS_NODE_ERROR, AS_NODE_ERROR_INVALID_MARKUP);
+       g_assert_cmpstr (error->message, ==, "Tag ul in ul invalid");
+       g_clear_error (&error);
+       g_assert (hashtable == NULL);
 }
 
 static void

Reply via email to