Refactor loop in dump_histogram()
commit37edc7ea9881a0fcd3df67fe1e29d22ee4deb7a9
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Mon, 6 Mar 2023 14:48:42 +0000 (6 09:48 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Mar 2023 21:52:20 +0000 (8 13:52 -0800)
treecc441d4660e51298fd53480f140aca5c17664f7a
parent08641d9007850fcd6dc43b4526b10db537f21d1f
Refactor loop in dump_histogram()

The current loop triggers a complaint that we are using an array offset
prior to a range check from cpp/offset-use-before-range-check when we
are actually calculating maximum and minimum values. I was about to file
a false positive report with CodeQL, but after looking at how the code
is structured, I really cannot blame CodeQL for mistaking this for a
range check.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14575
cmd/zdb/zdb.c