From 3809cb41bce3687d11caaff702a4da8b7829fe2d Mon Sep 17 00:00:00 2001 From: Andreas Vogel Date: Wed, 29 Feb 2012 19:35:19 +0100 Subject: [PATCH] * grub-core/kern/misc.c (grub_xvasprintf): Fix an exit path which resulted in leak of arguments. --- ChangeLog | 5 +++++ grub-core/kern/misc.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bc44f7ebf..72066dc5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-29 Andreas Vogel + + * grub-core/kern/misc.c (grub_xvasprintf): Fix an exit path which + resulted in leak of arguments. + 2012-02-29 Vladimir Serbinenko * grub-core/boot/i386/pc/startup_raw.S: Use separate diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index ad67ed257..164fd6e30 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1060,11 +1060,12 @@ grub_xvasprintf (const char *fmt, va_list ap) while (1) { va_list ap2; - va_copy (ap2, ap); ret = grub_malloc (as + 1); if (!ret) return NULL; + va_copy (ap2, ap); + s = grub_vsnprintf_real (ret, as, fmt, ap2); va_end (ap2);