libgpg-error/core-Initialize-values-in-estream_format.patch
2019-09-30 10:56:22 -04:00

41 lines
1.2 KiB
Diff

From fe2f8fca3114e3a5727fdbbc5e7ebc4e442d0401 Mon Sep 17 00:00:00 2001
From: Andre Heinecke <aheinecke@intevation.de>
Date: Wed, 4 Jul 2018 18:19:42 +0200
Subject: [PATCH 06/97] core: Initialize values in estream_format
* src/estream-printf.c (_gpgrt_estream_format): Make sure
valuetable.value is inialized even on stack.
--
This makes the behavior more consistent with the calloc'ed
codepath for more then 8 variables.
It also fixes a potential crash if there were unmatched
format args provided.
GnuPG-Bug-Id: T4054
---
src/estream-printf.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/estream-printf.c b/src/estream-printf.c
index f1cbcde..eb6fa3a 100644
--- a/src/estream-printf.c
+++ b/src/estream-printf.c
@@ -1565,7 +1565,11 @@ _gpgrt_estream_format (estream_printf_out_t outfnc,
else
{
for (validx=0; validx < DIM(valuetable_buffer); validx++)
- valuetable[validx].vt = VALTYPE_UNSUPPORTED;
+ {
+ valuetable[validx].vt = VALTYPE_UNSUPPORTED;
+ memset (&valuetable[validx].value, 0,
+ sizeof valuetable[validx].value);
+ }
}
for (argidx=0; argidx < argspecs_len; argidx++)
{
--
1.8.3.1