]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix -Wstringop-overflow warning
authorNick Terrell <terrelln@fb.com>
Fri, 20 Jan 2023 19:29:52 +0000 (11:29 -0800)
committerNick Terrell <nickrterrell@gmail.com>
Mon, 23 Jan 2023 18:12:25 +0000 (10:12 -0800)
Backported from kernel patch [0].

I wasn't able to reproduce the warning locally, but could repro it in
the kernel.

[0] https://lore.kernel.org/lkml/20220330193352.GA119296@embeddedor/

lib/decompress/huf_decompress.c

index 400a4e44d53296fa2da5c392162f41205563b808..3cafeba53401e159920fdd379aa811391a763add 100644 (file)
@@ -934,7 +934,7 @@ static void HUF_fillDTableX2Level2(HUF_DEltX2* DTable, U32 targetLog, const U32
 
 static void HUF_fillDTableX2(HUF_DEltX2* DTable, const U32 targetLog,
                            const sortedSymbol_t* sortedList,
-                           const U32* rankStart, rankVal_t rankValOrigin, const U32 maxWeight,
+                           const U32* rankStart, rankValCol_t* rankValOrigin, const U32 maxWeight,
                            const U32 nbBitsBaseline)
 {
     U32* const rankVal = rankValOrigin[0];