Fixed findings

List of Findings

Error: CPPCHECK_WARNING (CWE-682): [#def1]
brotli-1.1.0/c/enc/block_splitter_inc.h:232: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  230|     size_t i;
#  231|     uint32_t* BROTLI_RESTRICT const sizes = u32 + 0 * HISTOGRAMS_PER_BATCH;
#  232|->   uint32_t* BROTLI_RESTRICT const new_clusters = u32 + 1 * HISTOGRAMS_PER_BATCH;
#  233|     uint32_t* BROTLI_RESTRICT const symbols = u32 + 2 * HISTOGRAMS_PER_BATCH;
#  234|     uint32_t* BROTLI_RESTRICT const remap = u32 + 3 * HISTOGRAMS_PER_BATCH;

Error: CPPCHECK_WARNING (CWE-682): [#def2]
brotli-1.1.0/c/enc/block_splitter_inc.h:233: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  231|     uint32_t* BROTLI_RESTRICT const sizes = u32 + 0 * HISTOGRAMS_PER_BATCH;
#  232|     uint32_t* BROTLI_RESTRICT const new_clusters = u32 + 1 * HISTOGRAMS_PER_BATCH;
#  233|->   uint32_t* BROTLI_RESTRICT const symbols = u32 + 2 * HISTOGRAMS_PER_BATCH;
#  234|     uint32_t* BROTLI_RESTRICT const remap = u32 + 3 * HISTOGRAMS_PER_BATCH;
#  235|     uint32_t* BROTLI_RESTRICT const block_lengths =

Error: CPPCHECK_WARNING (CWE-682): [#def3]
brotli-1.1.0/c/enc/block_splitter_inc.h:234: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  232|     uint32_t* BROTLI_RESTRICT const new_clusters = u32 + 1 * HISTOGRAMS_PER_BATCH;
#  233|     uint32_t* BROTLI_RESTRICT const symbols = u32 + 2 * HISTOGRAMS_PER_BATCH;
#  234|->   uint32_t* BROTLI_RESTRICT const remap = u32 + 3 * HISTOGRAMS_PER_BATCH;
#  235|     uint32_t* BROTLI_RESTRICT const block_lengths =
#  236|         u32 + 4 * HISTOGRAMS_PER_BATCH;

Error: CPPCHECK_WARNING (CWE-682): [#def4]
brotli-1.1.0/c/enc/block_splitter_inc.h:236: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  234|     uint32_t* BROTLI_RESTRICT const remap = u32 + 3 * HISTOGRAMS_PER_BATCH;
#  235|     uint32_t* BROTLI_RESTRICT const block_lengths =
#  236|->       u32 + 4 * HISTOGRAMS_PER_BATCH;
#  237|     /* TODO(eustas): move to arena? */
#  238|     HistogramType* tmp = BROTLI_ALLOC(m, HistogramType, 2);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
brotli-1.1.0/c/enc/block_splitter_inc.h:278:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u32’
brotli-1.1.0/c/enc/block_splitter_inc.h:201:13: enter_function: entry to ‘ClusterBlocksCommand’
brotli-1.1.0/c/enc/block_splitter_inc.h:206:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.1.0/c/enc/block_splitter_inc.h:206:33: branch_true: ...to here
brotli-1.1.0/c/enc/block_splitter_inc.h:208:7: branch_false: following ‘false’ branch (when ‘num_blocks == 18446744073709551360’)...
brotli-1.1.0/c/enc/block_splitter_inc.h:210:7: branch_false: ...to here
brotli-1.1.0/c/enc/block_splitter_inc.h:214:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.1.0/c/enc/block_splitter_inc.h:219:31: branch_false: ...to here
brotli-1.1.0/c/enc/block_splitter_inc.h:219:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.1.0/c/enc/block_splitter_inc.h:219:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksCommand’
brotli-1.1.0/c/enc/block_splitter_inc.h:263:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.1.0/c/enc/block_splitter_inc.h:265:9: branch_true: ...to here
brotli-1.1.0/c/enc/block_splitter_inc.h:268:17: branch_true: following ‘true’ branch...
brotli-1.1.0/c/enc/block_splitter_inc.h:270:43: branch_true: ...to here
brotli-1.1.0/c/enc/block_splitter_inc.h:272:19: branch_false: following ‘false’ branch (when ‘k >= block_length’)...
brotli-1.1.0/c/enc/block_splitter_inc.h:275:33: branch_false: ...to here
brotli-1.1.0/c/enc/block_splitter_inc.h:278:7: danger: dereference of NULL ‘u32 + j * 4’
#  276|         new_clusters[j] = (uint32_t)j;
#  277|         symbols[j] = (uint32_t)j;
#  278|->       sizes[j] = 1;
#  279|       }
#  280|       num_new_clusters = FN(BrotliHistogramCombine)(

Error: COMPILER_WARNING (CWE-686): [#def6]
brotli-1.1.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-konhm0/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘log2’; expected ‘double(double)’

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-223.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namebrotli-1.2.0-1.fc44
diffbase-store-results-to/tmp/tmpz793igm_/brotli-1.2.0-1.fc44.tar.xz
diffbase-time-created2026-01-08 15:42:47
diffbase-time-finished2026-01-08 15:45:52
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpz793igm_/brotli-1.2.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpz793igm_/brotli-1.2.0-1.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-223.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namebrotli-1.1.0-10.fc43
store-results-to/tmp/tmp5cox1aqg/brotli-1.1.0-10.fc43.tar.xz
time-created2026-01-08 15:39:02
time-finished2026-01-08 15:42:28
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp5cox1aqg/brotli-1.1.0-10.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp5cox1aqg/brotli-1.1.0-10.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9