]> git.ipfire.org Git - thirdparty/zstd.git/commit
[ldm] Fix ZSTD_c_ldmHashRateLog bounds check
authorNick Terrell <terrelln@fb.com>
Fri, 8 Oct 2021 18:17:40 +0000 (11:17 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 11 Oct 2021 22:43:57 +0000 (15:43 -0700)
commit5a3e16f0c210791a70e1665810d081efd3da0821
treeceb498be0c79f55acbcec10559a04b97d704f211
parent2c94f9fc614f5adc6a0a9aaa319e975cc4d81f1f
[ldm] Fix ZSTD_c_ldmHashRateLog bounds check

There is no minimum value check, so the parameter could be negative.
Switch to the standard pattern of using `BOUNDCHECK()`.

The bug was reported by Dan Carpenter and found by Smatch static
checker.

https://lore.kernel.org/all/20211008063704.GA5370@kili/
lib/compress/zstd_compress.c