[glib: 1/2] Avoid overrunning stack at the end of the varargs.
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] Avoid overrunning stack at the end of the varargs.
- Date: Mon, 24 Jun 2019 13:27:48 +0000 (UTC)
commit 633e9e0bcbe445c43a56929c957f94b55dc92b46
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]