File glib2-CVE-2018-16428.patch of Package glib2.28986

diff -Nura glib-2.48.2/glib/gmarkup.c glib-2.48.2_new/glib/gmarkup.c
--- glib-2.48.2/glib/gmarkup.c	2016-08-17 23:20:47.000000000 +0800
+++ glib-2.48.2_new/glib/gmarkup.c	2018-10-16 22:29:30.364737162 +0800
@@ -1833,9 +1833,14 @@
     case STATE_AFTER_CLOSE_TAG_SLASH:
     case STATE_INSIDE_CLOSE_TAG_NAME:
     case STATE_AFTER_CLOSE_TAG_NAME:
-      set_error (context, error, G_MARKUP_ERROR_PARSE,
-                 _("Document ended unexpectedly inside the close tag for "
-                   "element '%s'"), current_element (context));
+      if (context->tag_stack != NULL)
+        set_error (context, error, G_MARKUP_ERROR_PARSE,
+                   _("Document ended unexpectedly inside the close tag for "
+                     "element ā€œ%sā€"), current_element (context));
+      else
+        set_error (context, error, G_MARKUP_ERROR_PARSE,
+                   _("Document ended unexpectedly inside the close tag for an "
+                     "unopened element"));
       break;
 
     case STATE_INSIDE_PASSTHROUGH:
diff -Nura glib-2.48.2/glib/tests/Makefile.am glib-2.48.2_new/glib/tests/Makefile.am
--- glib-2.48.2/glib/tests/Makefile.am	2016-08-18 00:07:39.000000000 +0800
+++ glib-2.48.2_new/glib/tests/Makefile.am	2018-10-16 22:30:00.798009555 +0800
@@ -155,6 +155,7 @@
 	fail-36 fail-37 fail-38 fail-39 fail-40 \
 	fail-41 fail-42 fail-43 fail-44 fail-45 \
 	fail-46 fail-47 fail-48 fail-49 \
+	fail-51 \
 	valid-1 valid-2 valid-3 valid-4 valid-5 \
 	valid-6 valid-7 valid-8 valid-9 valid-10 \
 	valid-11 valid-12 valid-13 valid-14 valid-15 \
diff -Nura glib-2.48.2/glib/tests/markups/fail-51.expected glib-2.48.2_new/glib/tests/markups/fail-51.expected
--- glib-2.48.2/glib/tests/markups/fail-51.expected	1970-01-01 08:00:00.000000000 +0800
+++ glib-2.48.2_new/glib/tests/markups/fail-51.expected	2018-10-16 22:30:39.364354742 +0800
@@ -0,0 +1 @@
+ERROR Error on line 1 char 5: Document ended unexpectedly inside the close tag for an unopened element
diff -Nura glib-2.48.2/glib/tests/markups/fail-51.gmarkup glib-2.48.2_new/glib/tests/markups/fail-51.gmarkup
--- glib-2.48.2/glib/tests/markups/fail-51.gmarkup	1970-01-01 08:00:00.000000000 +0800
+++ glib-2.48.2_new/glib/tests/markups/fail-51.gmarkup	2018-10-16 22:31:04.832582695 +0800
@@ -0,0 +1 @@
+</0<
openSUSE Build Service is sponsored by