mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
Copy a va_list when using it multiple times. Reported by Wim Lewis.
* glib/gmessages.c (g_logv): Copy a va_list when using it multiple times. Reported by Wim Lewis. svn path=/trunk/; revision=8021
This commit is contained in:
parent
dabbea65c6
commit
a6ebda3d69
@ -1,3 +1,11 @@
|
|||||||
|
2009-03-29 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Bug 577137 – g_logv() will crash if given format args and multiple
|
||||||
|
log levels
|
||||||
|
|
||||||
|
* glib/gmessages.c (g_logv): Copy a va_list when using it
|
||||||
|
multiple times. Reported by Wim Lewis.
|
||||||
|
|
||||||
2009-03-16 Alexander Larsson <alexl@redhat.com>
|
2009-03-16 Alexander Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
Bug 575555 – Use fsync() when replacing files to avoid data loss on crash
|
Bug 575555 – Use fsync() when replacing files to avoid data loss on crash
|
||||||
|
@ -462,14 +462,23 @@ g_logv (const gchar *log_domain,
|
|||||||
* in an out-of-memory situation
|
* in an out-of-memory situation
|
||||||
*/
|
*/
|
||||||
gchar buffer[1025];
|
gchar buffer[1025];
|
||||||
gint size;
|
gsize size;
|
||||||
size = _g_vsnprintf (buffer, 1024, format, args1);
|
va_list args2;
|
||||||
|
|
||||||
|
G_VA_COPY (args2, args1);
|
||||||
|
size = _g_vsnprintf (buffer, 1024, format, args2);
|
||||||
|
va_end (args2);
|
||||||
|
|
||||||
log_func (log_domain, test_level, buffer, data);
|
log_func (log_domain, test_level, buffer, data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gchar *msg = g_strdup_vprintf (format, args1);
|
gchar *msg;
|
||||||
|
va_list args2;
|
||||||
|
|
||||||
|
G_VA_COPY (args2, args1);
|
||||||
|
msg = g_strdup_vprintf (format, args2);
|
||||||
|
va_end (args2);
|
||||||
|
|
||||||
log_func (log_domain, test_level, msg, data);
|
log_func (log_domain, test_level, msg, data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user