]> git.ipfire.org Git - thirdparty/zstd.git/commit
[ldm] Fix ZSTD_c_ldmHashRateLog bounds check 2819/head
authorNick Terrell <terrelln@fb.com>
Fri, 8 Oct 2021 18:17:40 +0000 (11:17 -0700)
committerNick Terrell <terrelln@fb.com>
Fri, 8 Oct 2021 18:17:40 +0000 (11:17 -0700)
commit1bbb372e3e2453a8f16813fc9d65c90f32eb9080
tree4a02d0b70aedccba759a313696ca2c8dc9856e07
parent52598d54e98d1de87a8e89c7fc0aa1bfc9b67e16
[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