From f55ffe6bd8b844a8cd9956702f42ac2eb96ad56f Mon Sep 17 00:00:00 2001 From: Darren Kenny Date: Thu, 5 Nov 2020 10:29:59 +0000 Subject: [PATCH] zstd: Initialize seq_t structure fully While many compilers will initialize this to zero, not all will, so it is better to be sure that fields not being explicitly set are at known values, and there is code that checks this fields value elsewhere in the code. Fixes: CID 292440 Signed-off-by: Darren Kenny Reviewed-by: Daniel Kiper Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2777cf4466719921dbe4b30af358a75e7d76f217] Signed-off-by: Marta Rybczynska --- grub-core/lib/zstd/zstd_decompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/lib/zstd/zstd_decompress.c b/grub-core/lib/zstd/zstd_decompress.c index 711b5b6..e4b5670 100644 --- a/grub-core/lib/zstd/zstd_decompress.c +++ b/grub-core/lib/zstd/zstd_decompress.c @@ -1325,7 +1325,7 @@ typedef enum { ZSTD_lo_isRegularOffset, ZSTD_lo_isLongOffset=1 } ZSTD_longOffset FORCE_INLINE_TEMPLATE seq_t ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) { - seq_t seq; + seq_t seq = {0}; U32 const llBits = seqState->stateLL.table[seqState->stateLL.state].nbAdditionalBits; U32 const mlBits = seqState->stateML.table[seqState->stateML.state].nbAdditionalBits; U32 const ofBits = seqState->stateOffb.table[seqState->stateOffb.state].nbAdditionalBits;