[glib/fix-gobject-signals-test-windows: 1/2] Avoid overrunning stack	at the end of the varargs.
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [glib/fix-gobject-signals-test-windows: 1/2] Avoid overrunning stack	at the end of the varargs.
- Date: Mon, 24 Jun 2019 15:52:56 +0000 (UTC)
commit 896a4d44cb71609d6c518d1e0772152b2437b7f9
Author: John Ralls <jralls ceridwen us>
Date:   Thu Jun 20 16:07:01 2019 -0700
    Avoid overrunning stack at the end of the varargs.
 glib/gmarkup.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/glib/gmarkup.c b/glib/gmarkup.c
index 8a4e943eb..5b70cef8d 100644
--- a/glib/gmarkup.c
+++ b/glib/gmarkup.c
@@ -2872,9 +2872,10 @@ g_markup_collect_attributes (const gchar         *element_name,
           g_assert_not_reached ();
         }
 
-      type = va_arg (ap, GMarkupCollectType);
-      attr = va_arg (ap, const char *);
       written++;
+      type = va_arg (ap, GMarkupCollectType);
+      if (type != G_MARKUP_COLLECT_INVALID)
+        attr = va_arg (ap, const char *);
     }
   va_end (ap);
 
@@ -2950,7 +2951,8 @@ failure:
         }
 
       type = va_arg (ap, GMarkupCollectType);
-      attr = va_arg (ap, const char *);
+      if (type != G_MARKUP_COLLECT_INVALID)
+        attr = va_arg (ap, const char *);
     }
   va_end (ap);
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]