summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <aheinecke@intevation.de>2018-07-04 18:19:42 +0200
committerAndre Heinecke <aheinecke@intevation.de>2018-07-05 08:38:27 +0200
commitfe2f8fca3114e3a5727fdbbc5e7ebc4e442d0401 (patch)
treebd4d2de0dd3260a6ce44931962a693c8d62b1322
parent043a91b8cd4bb71cb96086b51d6bc1b1a1821a41 (diff)
downloadlibgpg-error-fe2f8fca3114e3a5727fdbbc5e7ebc4e442d0401.tar.gz
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
-rw-r--r--src/estream-printf.c6
1 files changed, 5 insertions, 1 deletions
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++)
{