Adding 01-Fix-crash-with-invalid-Name-tag-in-a-menu.patch from upstream (Closes:...
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Mon, 24 Apr 2017 20:00:29 +0000 (23:00 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Mon, 24 Apr 2017 20:00:29 +0000 (23:00 +0300)
debian/patches/01-Fix-crash-with-invalid-Name-tag-in-a-menu.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]

diff --git a/debian/patches/01-Fix-crash-with-invalid-Name-tag-in-a-menu.patch b/debian/patches/01-Fix-crash-with-invalid-Name-tag-in-a-menu.patch
new file mode 100644 (file)
index 0000000..ecacd0e
--- /dev/null
@@ -0,0 +1,32 @@
+Author: Andriy Grytsenko <andrej@rep.kiev.ua>
+Description: Fix crash with invalid <Name> tag in a menu. (Closes: #849356, #851748)
+Bug: https://sourceforge.net/p/lxde/bugs/863
+Applied-Upstream: 54ab9e45764435634cdf5de360b295ee3a22817a
+
+--- a/menu-cache-gen/menu-merge.c
++++ b/menu-cache-gen/menu-merge.c
+@@ -1,7 +1,7 @@
+ /*
+  *      menu-file.c : parses <name>.menu file and merges all XML tags.
+  *
+- *      Copyright 2013-2016 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
++ *      Copyright 2013-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+  *
+  *      This file is a part of libmenu-cache package and created program
+  *      should be not used without the library.
+@@ -138,11 +138,13 @@ static gboolean _menu_xml_handler_Name(FmXmlFileItem *item, GList *children,
+                                        guint n_attributes, gint line, gint pos,
+                                        GError **error, gpointer user_data)
+ {
++    FmXmlFileItem *name_item;
+     const char *name;
+     RETURN_IF_IN_LAYOUT(item, error);
+-    item = fm_xml_file_item_find_child(item, FM_XML_FILE_TEXT);
+-    if (item == NULL || (name = fm_xml_file_item_get_data(item, NULL)) == NULL ||
++    name_item = fm_xml_file_item_find_child(item, FM_XML_FILE_TEXT);
++    if (name_item == NULL ||
++        (name = fm_xml_file_item_get_data(name_item, NULL)) == NULL ||
+         strchr(name, '/') != NULL) /* empty or invalid tag */
+     {
+         RETURN_TRUE_AND_DESTROY_IF_QUIET(item);
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..835f7ff
--- /dev/null
@@ -0,0 +1 @@
+01-Fix-crash-with-invalid-Name-tag-in-a-menu.patch