From 3fd55538c979aaad3fd8d5665408c26862b1b163 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Mon, 30 Dec 2024 01:40:24 +0300 Subject: [PATCH] miniz: apply CVE-2018-12913 fix from mainstream --- Quake/miniz.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Quake/miniz.c b/Quake/miniz.c index a9318862d..1a1802818 100644 --- a/Quake/miniz.c +++ b/Quake/miniz.c @@ -649,6 +649,12 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex bit_buf >>= code_len; num_bits -= code_len; + /* assert(sym2 != 0 && counter != 0); */ + if (sym2 == 0 && counter == 0) + { + TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED); + } + pOut_buf_cur[0] = (mz_uint8)counter; if (sym2 & 256) {