brotli-1.2.0-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
brotli-1.2.0/c/common/shared_dictionary.c:505:20: warning[-Wanalyzer-malloc-leak]: leak of ‘dict’
brotli-1.2.0/c/common/shared_dictionary.c:487:6: branch_true: following ‘true’ branch...
brotli-1.2.0/c/common/shared_dictionary.c:488:37: branch_true: ...to here
brotli-1.2.0/c/common/shared_dictionary.c:488:37: acquire_memory: allocated here
brotli-1.2.0/c/common/shared_dictionary.c:493:6: branch_false: following ‘false’ branch (when ‘dict’ is non-NULL)...
brotli-1.2.0/c/common/shared_dictionary.c:498:3: branch_false: ...to here
brotli-1.2.0/c/common/shared_dictionary.c:505:20: throw: if ‘BrotliGetDictionary’ throws an exception...
brotli-1.2.0/c/common/shared_dictionary.c:505:20: danger: ‘dict’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  503|     dict->num_transform_lists = 0;
#  504|   
#  505|->   dict->words[0] = BrotliGetDictionary();
#  506|     dict->transforms[0] = BrotliGetTransforms();
#  507|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
brotli-1.2.0/c/common/shared_dictionary.c:506:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dict’
brotli-1.2.0/c/common/shared_dictionary.c:487:6: branch_true: following ‘true’ branch...
brotli-1.2.0/c/common/shared_dictionary.c:488:37: branch_true: ...to here
brotli-1.2.0/c/common/shared_dictionary.c:488:37: acquire_memory: allocated here
brotli-1.2.0/c/common/shared_dictionary.c:493:6: branch_false: following ‘false’ branch (when ‘dict’ is non-NULL)...
brotli-1.2.0/c/common/shared_dictionary.c:498:3: branch_false: ...to here
brotli-1.2.0/c/common/shared_dictionary.c:506:25: throw: if ‘BrotliGetTransforms’ throws an exception...
brotli-1.2.0/c/common/shared_dictionary.c:506:25: danger: ‘dict’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  504|   
#  505|     dict->words[0] = BrotliGetDictionary();
#  506|->   dict->transforms[0] = BrotliGetTransforms();
#  507|   
#  508|     dict->alloc_func = alloc_func ? alloc_func : BrotliDefaultAllocFunc;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
brotli-1.2.0/c/enc/backward_references_hq.c:49:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘nodes’
brotli-1.2.0/c/enc/backward_references_hq.c:797:6: enter_function: entry to ‘BrotliCreateZopfliBackwardReferences’
brotli-1.2.0/c/enc/backward_references_hq.c:802:23: branch_false: following ‘false’ branch (when ‘num_bytes == 18446744073709551615’)...
brotli-1.2.0/c/enc/backward_references_hq.c:804:3: branch_false: ...to here
brotli-1.2.0/c/enc/backward_references_hq.c:804:3: call_function: inlined call to ‘BrotliInitZopfliNodes’ from ‘BrotliCreateZopfliBackwardReferences’
#   47|     stub.dcode_insert_length = 0;
#   48|     stub.u.cost = kInfinity;
#   49|->   for (i = 0; i < length; ++i) array[i] = stub;
#   50|   }
#   51|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
brotli-1.2.0/c/enc/backward_references_hq.c:222:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘literal_costs’
brotli-1.2.0/c/enc/backward_references_hq.c:707:8: enter_function: entry to ‘BrotliZopfliComputeShortestPath’
brotli-1.2.0/c/enc/backward_references_hq.c:730:3: call_function: calling ‘InitZopfliCostModel’ from ‘BrotliZopfliComputeShortestPath’
brotli-1.2.0/c/enc/backward_references_hq.c:730:3: return_function: returning to ‘BrotliZopfliComputeShortestPath’ from ‘InitZopfliCostModel’
brotli-1.2.0/c/enc/backward_references_hq.c:732:3: call_function: calling ‘ZopfliCostModelSetFromLiteralCosts’ from ‘BrotliZopfliComputeShortestPath’
#  220|                                       ringbuffer, self->literal_histograms,
#  221|                                       &literal_costs[1]);
#  222|->   literal_costs[0] = 0.0;
#  223|     for (i = 0; i < num_bytes; ++i) {
#  224|       literal_carry += literal_costs[i + 1];

Error: CPPCHECK_WARNING (CWE-476): [#def5]
brotli-1.2.0/c/enc/backward_references_hq.c:611: error[ctunullpointer]: Null pointer dereference: nodes
#  609|     const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin);
#  610|     size_t pos = 0;
#  611|->   uint32_t offset = nodes[0].u.next;
#  612|     size_t i;
#  613|     size_t gap = params->dictionary.compound.total_size;

Error: CPPCHECK_WARNING (CWE-476): [#def6]
brotli-1.2.0/c/enc/backward_references_hq.c:611: warning[nullPointer]: Possible null pointer dereference: nodes
#  609|     const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin);
#  610|     size_t pos = 0;
#  611|->   uint32_t offset = nodes[0].u.next;
#  612|     size_t i;
#  613|     size_t gap = params->dictionary.compound.total_size;

Error: CPPCHECK_WARNING (CWE-476): [#def7]
brotli-1.2.0/c/enc/backward_references_hq.c:728: warning[nullPointer]: Possible null pointer dereference: nodes
#  726|       return 0;
#  727|     }
#  728|->   nodes[0].length = 0;
#  729|     nodes[0].u.cost = 0;
#  730|     InitZopfliCostModel(m, model, &params->dist, num_bytes);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
brotli-1.2.0/c/enc/backward_references_hq.c:728:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘nodes’
brotli-1.2.0/c/enc/backward_references_hq.c:797:6: enter_function: entry to ‘BrotliCreateZopfliBackwardReferences’
brotli-1.2.0/c/enc/backward_references_hq.c:802:23: branch_false: following ‘false’ branch (when ‘num_bytes == 18446744073709551615’)...
brotli-1.2.0/c/enc/backward_references_hq.c:804:3: branch_false: ...to here
brotli-1.2.0/c/enc/backward_references_hq.c:804:3: call_function: inlined call to ‘BrotliInitZopfliNodes’ from ‘BrotliCreateZopfliBackwardReferences’
brotli-1.2.0/c/enc/backward_references_hq.c:805:20: branch_false: ...to here
brotli-1.2.0/c/enc/backward_references_hq.c:805:20: call_function: calling ‘BrotliZopfliComputeShortestPath’ from ‘BrotliCreateZopfliBackwardReferences’
#  726|       return 0;
#  727|     }
#  728|->   nodes[0].length = 0;
#  729|     nodes[0].u.cost = 0;
#  730|     InitZopfliCostModel(m, model, &params->dist, num_bytes);

Error: CPPCHECK_WARNING (CWE-476): [#def9]
brotli-1.2.0/c/enc/backward_references_hq.c:729: warning[nullPointer]: Possible null pointer dereference: nodes
#  727|     }
#  728|     nodes[0].length = 0;
#  729|->   nodes[0].u.cost = 0;
#  730|     InitZopfliCostModel(m, model, &params->dist, num_bytes);
#  731|     if (BROTLI_IS_OOM(m)) return 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def10]
brotli-1.2.0/c/enc/block_splitter.c:62:7: warning[-Wanalyzer-null-argument]: use of NULL ‘literals’ where non-null expected
brotli-1.2.0/c/enc/block_splitter.c:123:6: enter_function: entry to ‘BrotliSplitBlock’
brotli-1.2.0/c/enc/block_splitter.c:134:29: call_function: inlined call to ‘CountLiterals’ from ‘BrotliSplitBlock’
brotli-1.2.0/c/enc/block_splitter.c:135:25: branch_false: following ‘false’ branch (when ‘total_length == 0’)...
brotli-1.2.0/c/enc/block_splitter.c:138:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter.c:138:5: call_function: calling ‘CopyLiteralsToByteArray’ from ‘BrotliSplitBlock’
#   60|       if (from_pos + insert_len > mask) {
#   61|         size_t head_size = mask + 1 - from_pos;
#   62|->       memcpy(literals + pos, data + from_pos, head_size);
#   63|         from_pos = 0;
#   64|         pos += head_size;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def11]
brotli-1.2.0/c/enc/block_splitter.c:68:7: warning[-Wanalyzer-null-argument]: use of NULL ‘literals’ where non-null expected
brotli-1.2.0/c/enc/block_splitter.c:123:6: enter_function: entry to ‘BrotliSplitBlock’
brotli-1.2.0/c/enc/block_splitter.c:134:29: call_function: inlined call to ‘CountLiterals’ from ‘BrotliSplitBlock’
brotli-1.2.0/c/enc/block_splitter.c:135:25: branch_false: following ‘false’ branch (when ‘total_length == 0’)...
brotli-1.2.0/c/enc/block_splitter.c:138:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter.c:138:5: call_function: calling ‘CopyLiteralsToByteArray’ from ‘BrotliSplitBlock’
#   66|       }
#   67|       if (insert_len > 0) {
#   68|->       memcpy(literals + pos, data + from_pos, insert_len);
#   69|         pos += insert_len;
#   70|       }

Error: CPPCHECK_WARNING (CWE-476): [#def12]
brotli-1.2.0/c/enc/block_splitter_inc.h:253: warning[nullPointer]: Possible null pointer dereference: u32
#  251|     }
#  252|   
#  253|->   memset(u32, 0, (num_blocks + 4 * HISTOGRAMS_PER_BATCH) * sizeof(uint32_t));
#  254|   
#  255|     /* Calculate block lengths (convert repeating values -> series length). */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def13]
brotli-1.2.0/c/enc/block_splitter_inc.h:253:3: warning[-Wanalyzer-null-argument]: use of NULL ‘u32’ where non-null expected
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_false: following ‘false’ branch (when ‘num_blocks == 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:212:7: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:253:3: danger: argument 1 (‘u32’) NULL where non-null expected
#  251|     }
#  252|   
#  253|->   memset(u32, 0, (num_blocks + 4 * HISTOGRAMS_PER_BATCH) * sizeof(uint32_t));
#  254|   
#  255|     /* Calculate block lengths (convert repeating values -> series length). */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def14]
brotli-1.2.0/c/enc/block_splitter_inc.h:260:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cluster_size’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_false: following ‘false’ branch (when ‘num_blocks == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: following ‘false’ branch (when ‘num_blocks == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:226:26: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_true: following ‘true’ branch (when ‘i < length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:260:22: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:260:9: danger: dereference of NULL ‘block_lengths + block_idx * 4’
#  258|       for (i = 0; i < length; ++i) {
#  259|         BROTLI_DCHECK(block_idx < num_blocks);
#  260|->       ++block_lengths[block_idx];
#  261|         if (i + 1 == length || block_ids[i] != block_ids[i + 1]) {
#  262|           ++block_idx;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def15]
brotli-1.2.0/c/enc/block_splitter_inc.h:260:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘histogram_symbols’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_false: following ‘false’ branch (when ‘num_blocks == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_true: following ‘true’ branch (when ‘expected_num_clusters != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: following ‘false’ branch (when ‘num_blocks == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:226:26: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_true: following ‘true’ branch (when ‘i < length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:260:22: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:260:9: danger: dereference of NULL ‘block_lengths + block_idx * 4’
#  258|       for (i = 0; i < length; ++i) {
#  259|         BROTLI_DCHECK(block_idx < num_blocks);
#  260|->       ++block_lengths[block_idx];
#  261|         if (i + 1 == length || block_ids[i] != block_ids[i + 1]) {
#  262|           ++block_idx;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
brotli-1.2.0/c/enc/block_splitter_inc.h:260:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u32’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_false: following ‘false’ branch (when ‘num_blocks == 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:212:7: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_true: following ‘true’ branch (when ‘i < length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:260:22: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:260:9: danger: dereference of NULL ‘block_lengths + block_idx * 4’
#  258|       for (i = 0; i < length; ++i) {
#  259|         BROTLI_DCHECK(block_idx < num_blocks);
#  260|->       ++block_lengths[block_idx];
#  261|         if (i + 1 == length || block_ids[i] != block_ids[i + 1]) {
#  262|           ++block_idx;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
brotli-1.2.0/c/enc/block_splitter_inc.h:276:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cluster_size’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: following ‘true’ branch (when ‘num_blocks != 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: following ‘false’ branch (when ‘i >= length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:276:43: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:276:29: danger: dereference of NULL ‘block_lengths + (i + j) * 4’
#  274|       for (j = 0; j < num_to_combine; ++j) {
#  275|         size_t k;
#  276|->       size_t block_length = block_lengths[i + j];
#  277|         FN(HistogramClear)(&histograms[j]);
#  278|         for (k = 0; k < block_length; ++k) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
brotli-1.2.0/c/enc/block_splitter_inc.h:276:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u32’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_false: following ‘false’ branch (when ‘num_blocks == 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:212:7: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: following ‘false’ branch (when ‘i >= length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:276:43: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:276:29: danger: dereference of NULL ‘block_lengths + (i + j) * 4’
#  274|       for (j = 0; j < num_to_combine; ++j) {
#  275|         size_t k;
#  276|->       size_t block_length = block_lengths[i + j];
#  277|         FN(HistogramClear)(&histograms[j]);
#  278|         for (k = 0; k < block_length; ++k) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def19]
brotli-1.2.0/c/enc/block_splitter_inc.h:282:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cluster_size’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: following ‘true’ branch (when ‘num_blocks != 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: following ‘false’ branch (when ‘i >= length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:286:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:299:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:302:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:276:43: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:278:19: branch_false: following ‘false’ branch (when ‘k >= block_length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:281:33: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:282:19: release_memory: ‘cluster_size’ is NULL
brotli-1.2.0/c/enc/block_splitter_inc.h:282:7: danger: dereference of NULL ‘new_clusters + j * 4’
#  280|         }
#  281|         histograms[j].bit_cost_ = FN(BrotliPopulationCost)(&histograms[j]);
#  282|->       new_clusters[j] = (uint32_t)j;
#  283|         symbols[j] = (uint32_t)j;
#  284|         sizes[j] = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def20]
brotli-1.2.0/c/enc/block_splitter_inc.h:282:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u32’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_false: following ‘false’ branch (when ‘num_blocks == 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:212:7: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: following ‘false’ branch (when ‘i >= length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:286:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:299:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:302:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:276:43: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:278:19: branch_false: following ‘false’ branch (when ‘k >= block_length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:281:33: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:282:19: release_memory: ‘u32’ is NULL
brotli-1.2.0/c/enc/block_splitter_inc.h:282:7: danger: dereference of NULL ‘new_clusters + j * 4’
#  280|         }
#  281|         histograms[j].bit_cost_ = FN(BrotliPopulationCost)(&histograms[j]);
#  282|->       new_clusters[j] = (uint32_t)j;
#  283|         symbols[j] = (uint32_t)j;
#  284|         sizes[j] = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def21]
brotli-1.2.0/c/enc/block_splitter_inc.h:295:58: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: following ‘true’ branch (when ‘num_blocks != 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: following ‘false’ branch (when ‘i >= length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:286:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_true: following ‘true’ branch (when ‘all_histograms_capacity == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:295:70: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:295:58: danger: dereference of NULL ‘new_clusters + j * 4’
#  293|       if (BROTLI_IS_OOM(m)) return;
#  294|       for (j = 0; j < num_new_clusters; ++j) {
#  295|->       all_histograms[all_histograms_size++] = histograms[new_clusters[j]];
#  296|         cluster_size[cluster_size_size++] = sizes[new_clusters[j]];
#  297|         remap[new_clusters[j]] = (uint32_t)j;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def22]
brotli-1.2.0/c/enc/block_splitter_inc.h:295:58: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u32’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_false: following ‘false’ branch (when ‘num_blocks == 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:212:7: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: following ‘false’ branch (when ‘i >= length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:286:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_true: following ‘true’ branch (when ‘all_histograms_capacity == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:295:70: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:295:58: danger: dereference of NULL ‘new_clusters + j * 4’
#  293|       if (BROTLI_IS_OOM(m)) return;
#  294|       for (j = 0; j < num_new_clusters; ++j) {
#  295|->       all_histograms[all_histograms_size++] = histograms[new_clusters[j]];
#  296|         cluster_size[cluster_size_size++] = sizes[new_clusters[j]];
#  297|         remap[new_clusters[j]] = (uint32_t)j;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def23]
brotli-1.2.0/c/enc/block_splitter_inc.h:340:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: following ‘true’ branch (when ‘num_blocks != 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: following ‘false’ branch (when ‘i >= length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:271:9: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:286:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:299:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:302:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_false: following ‘false’ branch (when ‘i >= num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:306:3: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:316:14: branch_true: following ‘true’ branch (when ‘num_clusters != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:316:14: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:318:15: branch_false: following ‘false’ branch (when ‘num_clusters <= i’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:321:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:329:15: branch_true: following ‘true’ branch (when ‘num_clusters != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:329:15: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:335:17: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:339:7: call_function: inlined call to ‘HistogramClearLiteral’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:340:36: release_memory: using NULL here
brotli-1.2.0/c/enc/block_splitter_inc.h:340:23: danger: dereference of NULL ‘block_lengths + i * 4’
#  338|         double best_bits;
#  339|         FN(HistogramClear)(tmp);
#  340|->       for (j = 0; j < block_lengths[i]; ++j) {
#  341|           FN(HistogramAdd)(tmp, data[pos++]);
#  342|         }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def24]
brotli-1.2.0/c/enc/block_splitter_inc.h:340:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clusters’
brotli-1.2.0/c/enc/block_splitter_inc.h:203:13: enter_function: entry to ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:208:33: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: following ‘true’ branch (when ‘num_blocks != 18446744073709551360’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:210:7: branch_true: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:216:7: branch_false: following ‘false’ branch (when ‘expected_num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: branch_true: following ‘true’ branch (when ‘num_blocks != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:221:31: call_function: inlined call to ‘brotli_min_size_t’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:236:7: branch_false: following ‘false’ branch (when ‘u32’ is NULL)...
brotli-1.2.0/c/enc/block_splitter_inc.h:244:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: following ‘false’ branch (when ‘i >= length’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:258:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:274:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:286:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:289:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:291:5: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:294:17: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:299:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:302:5: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:269:15: branch_false: following ‘false’ branch (when ‘i >= num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:306:3: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:316:14: branch_false: following ‘false’ branch (when ‘num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:318:3: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:318:15: branch_false: following ‘false’ branch (when ‘num_clusters <= i’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:321:24: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:329:15: branch_false: following ‘false’ branch (when ‘num_clusters == 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:331:3: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:331:15: branch_false: following ‘false’ branch (when ‘num_clusters <= i’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:331:15: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:335:17: branch_true: following ‘true’ branch (when ‘i < num_blocks’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:339:7: call_function: inlined call to ‘HistogramClearLiteral’ from ‘ClusterBlocksLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:340:36: release_memory: ‘clusters’ is NULL
brotli-1.2.0/c/enc/block_splitter_inc.h:340:23: danger: dereference of NULL ‘block_lengths + i * 4’
#  338|         double best_bits;
#  339|         FN(HistogramClear)(tmp);
#  340|->       for (j = 0; j < block_lengths[i]; ++j) {
#  341|           FN(HistogramAdd)(tmp, data[pos++]);
#  342|         }

Error: CPPCHECK_WARNING (CWE-682): [#def25]
brotli-1.2.0/c/enc/block_splitter_inc.h:440: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  438|     }
#  439|     histograms = BROTLI_ALLOC(m, HistogramType, num_histograms + 1);
#  440|->   tmp = histograms + num_histograms;
#  441|     if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(histograms)) return;
#  442|     /* Find good entropy codes. */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
brotli-1.2.0/c/enc/cluster_inc.h:214:59: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tmp’
brotli-1.2.0/c/enc/cluster_inc.h:214:59: branch_true: following ‘true’ branch (when ‘length != 0’)...
brotli-1.2.0/c/enc/cluster_inc.h:214:59: branch_true: ...to here
brotli-1.2.0/c/enc/cluster_inc.h:214:59: branch_false: following ‘false’ branch (when ‘next_index == 0’)...
brotli-1.2.0/c/enc/cluster_inc.h:214:59: branch_false: ...to here
brotli-1.2.0/c/enc/cluster_inc.h:214:59: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/cluster_inc.h:214:59: danger: dereference of NULL ‘tmp + (long unsigned int)next_index * 2192’
#  212|      Returns N, the number of unique values in symbols[]. */
#  213|   BROTLI_INTERNAL size_t FN(BrotliHistogramReindex)(MemoryManager* m,
#  214|->     HistogramType* out, uint32_t* symbols, size_t length) CODE({
#  215|     static const uint32_t kInvalidIndex = BROTLI_UINT32_MAX;
#  216|     uint32_t* new_index = BROTLI_ALLOC(m, uint32_t, length);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def27]
brotli-1.2.0/c/enc/compound_dictionary.c:88:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
brotli-1.2.0/c/enc/compound_dictionary.c:40:6: branch_false: following ‘false’ branch (when ‘slot_bits <= 16’)...
brotli-1.2.0/c/enc/compound_dictionary.c:41:6: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:41:6: branch_false: following ‘false’ branch (when ‘slot_bits <= bucket_bits’)...
brotli-1.2.0/c/enc/compound_dictionary.c:42:7: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:42:6: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/compound_dictionary.c:44:10: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:44:10: branch_false: following ‘false’ branch (when ‘alloc_size == 0’)...
brotli-1.2.0/c/enc/compound_dictionary.c:48:38: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:68:15: branch_true: following ‘true’ branch (when ‘i < num_slots’)...
brotli-1.2.0/c/enc/compound_dictionary.c:70:15: branch_true: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:87:10: branch_true: following ‘true’ branch (when ‘overflow == 0’)...
brotli-1.2.0/c/enc/compound_dictionary.c:88:18: branch_true: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:88:9: danger: dereference of NULL ‘flat + (long unsigned int)i * 4’
#   86|         }
#   87|         if (!overflow) {
#   88|->         slot_size[i] = count;
#   89|           total_items += count;
#   90|           break;

Error: CPPCHECK_WARNING (CWE-476): [#def28]
brotli-1.2.0/c/enc/compound_dictionary.c:111: warning[nullPointer]: Possible null pointer dereference: result
#  109|     source_ref = (uint8_t**)(&items[total_items]);
#  110|   
#  111|->   result->magic = kLeanPreparedDictionaryMagic;
#  112|     result->num_items = total_items;
#  113|     result->source_size = (uint32_t)source_size;

Error: CPPCHECK_WARNING (CWE-476): [#def29]
brotli-1.2.0/c/enc/compound_dictionary.c:112: warning[nullPointer]: Possible null pointer dereference: result
#  110|   
#  111|     result->magic = kLeanPreparedDictionaryMagic;
#  112|->   result->num_items = total_items;
#  113|     result->source_size = (uint32_t)source_size;
#  114|     result->hash_bits = hash_bits;

Error: CPPCHECK_WARNING (CWE-476): [#def30]
brotli-1.2.0/c/enc/compound_dictionary.c:113: warning[nullPointer]: Possible null pointer dereference: result
#  111|     result->magic = kLeanPreparedDictionaryMagic;
#  112|     result->num_items = total_items;
#  113|->   result->source_size = (uint32_t)source_size;
#  114|     result->hash_bits = hash_bits;
#  115|     result->bucket_bits = bucket_bits;

Error: CPPCHECK_WARNING (CWE-476): [#def31]
brotli-1.2.0/c/enc/compound_dictionary.c:114: warning[nullPointer]: Possible null pointer dereference: result
#  112|     result->num_items = total_items;
#  113|     result->source_size = (uint32_t)source_size;
#  114|->   result->hash_bits = hash_bits;
#  115|     result->bucket_bits = bucket_bits;
#  116|     result->slot_bits = slot_bits;

Error: CPPCHECK_WARNING (CWE-476): [#def32]
brotli-1.2.0/c/enc/compound_dictionary.c:115: warning[nullPointer]: Possible null pointer dereference: result
#  113|     result->source_size = (uint32_t)source_size;
#  114|     result->hash_bits = hash_bits;
#  115|->   result->bucket_bits = bucket_bits;
#  116|     result->slot_bits = slot_bits;
#  117|     BROTLI_UNALIGNED_STORE_PTR(source_ref, source);

Error: CPPCHECK_WARNING (CWE-476): [#def33]
brotli-1.2.0/c/enc/compound_dictionary.c:116: warning[nullPointer]: Possible null pointer dereference: result
#  114|     result->hash_bits = hash_bits;
#  115|     result->bucket_bits = bucket_bits;
#  116|->   result->slot_bits = slot_bits;
#  117|     BROTLI_UNALIGNED_STORE_PTR(source_ref, source);
#  118|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def34]
brotli-1.2.0/c/enc/compound_dictionary.c:130:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
brotli-1.2.0/c/enc/compound_dictionary.c:40:6: branch_false: following ‘false’ branch (when ‘slot_bits <= 16’)...
brotli-1.2.0/c/enc/compound_dictionary.c:41:6: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:41:6: branch_false: following ‘false’ branch (when ‘slot_bits <= bucket_bits’)...
brotli-1.2.0/c/enc/compound_dictionary.c:42:7: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:42:6: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/compound_dictionary.c:44:10: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:44:10: branch_false: following ‘false’ branch (when ‘alloc_size == 0’)...
brotli-1.2.0/c/enc/compound_dictionary.c:48:38: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:68:15: branch_false: following ‘false’ branch (when ‘i >= num_slots’)...
brotli-1.2.0/c/enc/compound_dictionary.c:97:45: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:120:15: branch_false: following ‘false’ branch (when ‘i >= num_slots’)...
brotli-1.2.0/c/enc/compound_dictionary.c:120:15: branch_false: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:125:15: branch_true: following ‘true’ branch (when ‘i < num_buckets’)...
brotli-1.2.0/c/enc/compound_dictionary.c:126:14: branch_true: ...to here
brotli-1.2.0/c/enc/compound_dictionary.c:130:30: release_memory: using NULL here
brotli-1.2.0/c/enc/compound_dictionary.c:130:21: danger: dereference of NULL ‘flat + (long unsigned int)slot * 4’
#  128|       uint32_t pos;
#  129|       size_t j;
#  130|->     size_t cursor = slot_size[slot];
#  131|       if (count > slot_limit[slot]) count = slot_limit[slot];
#  132|       if (count == 0) {

Error: CPPCHECK_WARNING (CWE-476): [#def35]
brotli-1.2.0/c/enc/encode.c:174: warning[nullPointer]: Possible null pointer dereference: table
#  172|   
#  173|     *table_size = htsize;
#  174|->   memset(table, 0, htsize * sizeof(*table));
#  175|     return table;
#  176|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def36]
brotli-1.2.0/c/enc/encode.c:1073:9: warning[-Wanalyzer-null-argument]: use of NULL ‘new_commands’ where non-null expected
brotli-1.2.0/c/enc/encode.c:1609:13: enter_function: entry to ‘BrotliEncoderCompressStream’
brotli-1.2.0/c/enc/encode.c:1613:8: call_function: calling ‘EnsureInitialized’ from ‘BrotliEncoderCompressStream’
brotli-1.2.0/c/enc/encode.c:1613:8: return_function: returning to ‘BrotliEncoderCompressStream’ from ‘EnsureInitialized’
brotli-1.2.0/c/enc/encode.c:1621:6: branch_true: following ‘true’ branch (when ‘op == 3’)...
brotli-1.2.0/c/enc/encode.c:1622:5: call_function: inlined call to ‘UpdateSizeHint’ from ‘BrotliEncoderCompressStream’
brotli-1.2.0/c/enc/encode.c:1623:12: call_function: calling ‘ProcessMetadata’ from ‘BrotliEncoderCompressStream’
# 1071|         if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_commands)) return BROTLI_FALSE;
# 1072|         if (s->commands_) {
# 1073|->         memcpy(new_commands, s->commands_, sizeof(Command) * s->num_commands_);
# 1074|           BROTLI_FREE(m, s->commands_);
# 1075|         }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
brotli-1.2.0/c/enc/histogram_inc.h:20:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
brotli-1.2.0/c/enc/metablock.c:336:13: enter_function: entry to ‘InitContextBlockSplitter’
brotli-1.2.0/c/enc/metablock.c:364:3: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/metablock.c:367:3: branch_false: ...to here
brotli-1.2.0/c/enc/metablock.c:371:17: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/metablock.c:371:3: branch_false: ...to here
brotli-1.2.0/c/enc/metablock.c:371:3: release_memory: ‘*histograms’ is NULL
brotli-1.2.0/c/enc/metablock.c:372:3: release_memory: ‘*self.histograms_’ is NULL
brotli-1.2.0/c/enc/metablock.c:375:3: call_function: inlined call to ‘ClearHistogramsLiteral’ from ‘InitContextBlockSplitter’
#   18|   static BROTLI_INLINE void FN(HistogramClear)(FN(Histogram)* self) {
#   19|     memset(self->data_, 0, sizeof(self->data_));
#   20|->   self->total_count_ = 0;
#   21|     self->bit_cost_ = HUGE_VAL;
#   22|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
brotli-1.2.0/c/enc/histogram_inc.h:20:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘histograms’
brotli-1.2.0/c/enc/block_splitter_inc.h:403:13: enter_function: entry to ‘SplitByteVectorLiteral’
brotli-1.2.0/c/enc/block_splitter_inc.h:422:6: branch_false: following ‘false’ branch (when ‘length != 0’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:427:6: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:427:6: branch_false: following ‘false’ branch (when ‘length > 127’)...
brotli-1.2.0/c/enc/block_splitter_inc.h:439:16: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:439:16: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/block_splitter_inc.h:440:20: branch_false: ...to here
brotli-1.2.0/c/enc/block_splitter_inc.h:443:3: call_function: calling ‘InitialEntropyCodesLiteral’ from ‘SplitByteVectorLiteral’
#   18|   static BROTLI_INLINE void FN(HistogramClear)(FN(Histogram)* self) {
#   19|     memset(self->data_, 0, sizeof(self->data_));
#   20|->   self->total_count_ = 0;
#   21|     self->bit_cost_ = HUGE_VAL;
#   22|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
brotli-1.2.0/c/enc/metablock.c:432:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘combined_histo’
brotli-1.2.0/c/enc/metablock.c:393:6: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/metablock.c:412:14: branch_false: ...to here
brotli-1.2.0/c/enc/metablock.c:412:13: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/metablock.c:419:9: branch_true: ...to here
brotli-1.2.0/c/enc/metablock.c:419:9: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/metablock.c:421:12: branch_false: ...to here
brotli-1.2.0/c/enc/metablock.c:424:17: branch_true: following ‘true’ branch (when ‘i < num_contexts’)...
brotli-1.2.0/c/enc/metablock.c:425:30: branch_true: ...to here
brotli-1.2.0/c/enc/metablock.c:429:19: branch_true: following ‘true’ branch (when ‘j != 2’)...
brotli-1.2.0/c/enc/metablock.c:430:21: branch_true: ...to here
brotli-1.2.0/c/enc/metablock.c:432:9: danger: dereference of NULL ‘combined_histo + jx * 1040’
#  430|           size_t jx = j * num_contexts + i;
#  431|           size_t last_histogram_ix = self->last_histogram_ix_[j] + i;
#  432|->         combined_histo[jx] = histograms[curr_histo_ix];
#  433|           HistogramAddHistogramLiteral(&combined_histo[jx],
#  434|               &histograms[last_histogram_ix]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def40]
brotli-1.2.0/c/enc/metablock.c:533:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
brotli-1.2.0/c/enc/metablock.c:526:7: branch_false: following ‘false’ branch...
brotli-1.2.0/c/enc/metablock.c:525:3: branch_false: ...to here
brotli-1.2.0/c/enc/metablock.c:525:3: release_memory: ‘*mb.literal_context_map’ is NULL
brotli-1.2.0/c/enc/metablock.c:529:15: branch_true: following ‘true’ branch...
brotli-1.2.0/c/enc/metablock.c:530:23: branch_true: ...to here
brotli-1.2.0/c/enc/metablock.c:532:17: branch_true: following ‘true’ branch (when ‘j != 64’)...
brotli-1.2.0/c/enc/metablock.c:534:38: branch_true: ...to here
brotli-1.2.0/c/enc/metablock.c:533:7: danger: dereference of NULL ‘<unknown> + ((i << 6) + j) * 4’
#  531|       size_t j;
#  532|       for (j = 0; j < (1u << BROTLI_LITERAL_CONTEXT_BITS); ++j) {
#  533|->       mb->literal_context_map[(i << BROTLI_LITERAL_CONTEXT_BITS) + j] =
#  534|             offset + static_context_map[j];
#  535|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
brotli-1.2.0/c/tools/brotli.c:825:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
brotli-1.2.0/c/tools/brotli.c:945:20: enter_function: entry to ‘NextFile’
brotli-1.2.0/c/tools/brotli.c:970:6: branch_false: following ‘false’ branch...
brotli-1.2.0/c/tools/brotli.c:973:9: branch_false: ...to here
brotli-1.2.0/c/tools/brotli.c:983:32: call_function: calling ‘FileSize’ from ‘NextFile’
#  823|       return -1;
#  824|     }
#  825|->   if (fseek(f, 0L, SEEK_END) != 0) {
#  826|       fclose(f);
#  827|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
brotli-1.2.0/c/tools/brotli.c:825:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
brotli-1.2.0/c/tools/brotli.c:945:20: enter_function: entry to ‘NextFile’
brotli-1.2.0/c/tools/brotli.c:970:6: branch_false: following ‘false’ branch...
brotli-1.2.0/c/tools/brotli.c:973:9: branch_false: ...to here
brotli-1.2.0/c/tools/brotli.c:983:32: call_function: calling ‘FileSize’ from ‘NextFile’
#  823|       return -1;
#  824|     }
#  825|->   if (fseek(f, 0L, SEEK_END) != 0) {
#  826|       fclose(f);
#  827|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
brotli-1.2.0/c/tools/brotli.c:829:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
brotli-1.2.0/c/tools/brotli.c:945:20: enter_function: entry to ‘NextFile’
brotli-1.2.0/c/tools/brotli.c:970:6: branch_false: following ‘false’ branch...
brotli-1.2.0/c/tools/brotli.c:973:9: branch_false: ...to here
brotli-1.2.0/c/tools/brotli.c:983:32: call_function: calling ‘FileSize’ from ‘NextFile’
#  827|       return -1;
#  828|     }
#  829|->   retval = ftell(f);
#  830|     if (fclose(f) != 0) {
#  831|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
brotli-1.2.0/c/tools/brotli.c:829:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
brotli-1.2.0/c/tools/brotli.c:945:20: enter_function: entry to ‘NextFile’
brotli-1.2.0/c/tools/brotli.c:970:6: branch_false: following ‘false’ branch...
brotli-1.2.0/c/tools/brotli.c:973:9: branch_false: ...to here
brotli-1.2.0/c/tools/brotli.c:983:32: call_function: calling ‘FileSize’ from ‘NextFile’
#  827|       return -1;
#  828|     }
#  829|->   retval = ftell(f);
#  830|     if (fclose(f) != 0) {
#  831|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
brotli-1.2.0/c/tools/brotli.c:1438:9: warning[-Wanalyzer-file-leak]: leak of FILE
brotli-1.2.0/c/tools/brotli.c:1395:20: enter_function: entry to ‘CompressFiles’
brotli-1.2.0/c/tools/brotli.c:1396:10: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1400:29: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1401:8: branch_false: following ‘false’ branch...
brotli-1.2.0/c/tools/brotli.c:1406:41: branch_false: ...to here
brotli-1.2.0/c/tools/brotli.c:1407:8: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1410:10: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1410:10: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1411:9: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1429:8: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1430:28: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1434:8: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1435:48: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1437:13: call_function: calling ‘OpenFiles’ from ‘CompressFiles’
brotli-1.2.0/c/tools/brotli.c:1437:13: return_function: returning to ‘CompressFiles’ from ‘OpenFiles’
brotli-1.2.0/c/tools/brotli.c:1438:8: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1438:9: danger: leaks here; was opened at [(20)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/19)
# 1436|       }
# 1437|       is_ok = OpenFiles(context);
# 1438|->     if (is_ok && !context->current_output_path &&
# 1439|           !context->force_overwrite && isatty(STDOUT_FILENO)) {
# 1440|         fprintf(stderr, "Use -h help. Use -f to force output to a terminal.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
brotli-1.2.0/c/tools/brotli.c:1438:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
brotli-1.2.0/c/tools/brotli.c:1395:20: enter_function: entry to ‘CompressFiles’
brotli-1.2.0/c/tools/brotli.c:1396:10: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1400:29: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1401:8: branch_false: following ‘false’ branch...
brotli-1.2.0/c/tools/brotli.c:1406:41: branch_false: ...to here
brotli-1.2.0/c/tools/brotli.c:1407:8: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1410:10: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1410:10: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1411:9: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1429:8: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1430:28: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1434:8: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1435:48: branch_true: ...to here
brotli-1.2.0/c/tools/brotli.c:1437:13: call_function: calling ‘OpenFiles’ from ‘CompressFiles’
brotli-1.2.0/c/tools/brotli.c:1437:13: return_function: returning to ‘CompressFiles’ from ‘OpenFiles’
brotli-1.2.0/c/tools/brotli.c:1438:8: branch_true: following ‘true’ branch...
brotli-1.2.0/c/tools/brotli.c:1438:9: danger: ‘<unknown>’ leaks here; was allocated at [(20)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/19)
# 1436|       }
# 1437|       is_ok = OpenFiles(context);
# 1438|->     if (is_ok && !context->current_output_path &&
# 1439|           !context->force_overwrite && isatty(STDOUT_FILENO)) {
# 1440|         fprintf(stderr, "Use -h help. Use -f to force output to a terminal.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
brotli-1.2.0/python/_brotli.c:209:12: warning[-Wanalyzer-malloc-leak]: leak of ‘new_tail’
brotli-1.2.0/python/_brotli.c:659:18: enter_function: entry to ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:676:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:680:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:680:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:685:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:685:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:689:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:689:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:693:3: call_function: inlined call to ‘Buffer_Init’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:697:8: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:701:15: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:709:7: call_function: calling ‘Buffer_Grow’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:709:7: return_function: returning to ‘brotli_Decompressor_process’ from ‘Buffer_Grow’
brotli-1.2.0/python/_brotli.c:709:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:714:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:734:6: branch_false: following ‘false’ branch (when ‘oom == 0’)...
brotli-1.2.0/python/_brotli.c:736:13: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:736:13: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:744:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:744:6: branch_true: following ‘true’ branch...
brotli-1.2.0/python/_brotli.c:745:16: branch_true: ...to here
brotli-1.2.0/python/_brotli.c:745:16: acquire_memory: allocated here
brotli-1.2.0/python/_brotli.c:746:8: branch_false: following ‘false’ branch (when ‘new_tail’ is non-NULL)...
brotli-1.2.0/python/_brotli.c:750:5: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:754:6: branch_true: following ‘true’ branch...
brotli-1.2.0/python/_brotli.c:756:5: call_function: calling ‘set_brotli_exception’ from ‘brotli_Decompressor_process’
#  207|     assert(t != NULL);
#  208|     assert(PyType_Check(t));
#  209|->   module = PyObject_GetAttrString(t, kModuleAttr);
#  210|     if (!module) return; /* AttributeError raised. */
#  211|     error = PyObject_GetAttrString(module, kErrorAttr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
brotli-1.2.0/python/_brotli.c:211:11: warning[-Wanalyzer-malloc-leak]: leak of ‘new_tail’
brotli-1.2.0/python/_brotli.c:659:18: enter_function: entry to ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:676:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:680:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:680:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:685:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:685:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:689:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:689:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:693:3: call_function: inlined call to ‘Buffer_Init’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:697:8: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:701:15: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:709:7: call_function: calling ‘Buffer_Grow’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:709:7: return_function: returning to ‘brotli_Decompressor_process’ from ‘Buffer_Grow’
brotli-1.2.0/python/_brotli.c:709:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:714:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:734:6: branch_false: following ‘false’ branch (when ‘oom == 0’)...
brotli-1.2.0/python/_brotli.c:736:13: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:736:13: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:744:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:744:6: branch_true: following ‘true’ branch...
brotli-1.2.0/python/_brotli.c:745:16: branch_true: ...to here
brotli-1.2.0/python/_brotli.c:745:16: acquire_memory: allocated here
brotli-1.2.0/python/_brotli.c:746:8: branch_false: following ‘false’ branch (when ‘new_tail’ is non-NULL)...
brotli-1.2.0/python/_brotli.c:750:5: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:754:6: branch_true: following ‘true’ branch...
brotli-1.2.0/python/_brotli.c:756:5: call_function: calling ‘set_brotli_exception’ from ‘brotli_Decompressor_process’
#  209|     module = PyObject_GetAttrString(t, kModuleAttr);
#  210|     if (!module) return; /* AttributeError raised. */
#  211|->   error = PyObject_GetAttrString(module, kErrorAttr);
#  212|     Py_DECREF(module);
#  213|     if (error == NULL) return; /* AttributeError raised. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
brotli-1.2.0/python/_brotli.c:214:3: warning[-Wanalyzer-malloc-leak]: leak of ‘new_tail’
brotli-1.2.0/python/_brotli.c:659:18: enter_function: entry to ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:676:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:680:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:680:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:685:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:685:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:689:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:689:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:693:3: call_function: inlined call to ‘Buffer_Init’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:697:8: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:701:15: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:709:7: call_function: calling ‘Buffer_Grow’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:709:7: return_function: returning to ‘brotli_Decompressor_process’ from ‘Buffer_Grow’
brotli-1.2.0/python/_brotli.c:709:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:714:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:734:6: branch_false: following ‘false’ branch (when ‘oom == 0’)...
brotli-1.2.0/python/_brotli.c:736:13: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:736:13: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:744:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:744:6: branch_true: following ‘true’ branch...
brotli-1.2.0/python/_brotli.c:745:16: branch_true: ...to here
brotli-1.2.0/python/_brotli.c:745:16: acquire_memory: allocated here
brotli-1.2.0/python/_brotli.c:746:8: branch_false: following ‘false’ branch (when ‘new_tail’ is non-NULL)...
brotli-1.2.0/python/_brotli.c:750:5: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:754:6: branch_true: following ‘true’ branch...
brotli-1.2.0/python/_brotli.c:756:5: call_function: calling ‘set_brotli_exception’ from ‘brotli_Decompressor_process’
#  212|     Py_DECREF(module);
#  213|     if (error == NULL) return; /* AttributeError raised. */
#  214|->   PyErr_SetString(error, msg);
#  215|     Py_DECREF(error);
#  216|   #else

Error: COMPILER_WARNING (CWE-681): [#def50]
brotli-1.2.0/python/_brotli.c: scope_hint: In function ‘Buffer_Finish’
brotli-1.2.0/python/_brotli.c:357:7: warning[-Wpointer-sign]: pointer targets in assignment from ‘char *’ to ‘uint8_t *’ {aka ‘unsigned char *’} differ in signedness
#  357 |   out = PyBytes_AS_STRING(result);
#      |       ^
#  355|     if (len == 0) return result;
#  356|   
#  357|->   out = PyBytes_AS_STRING(result);
#  358|     block = buffer->head;
#  359|     while (block != buffer->tail) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
brotli-1.2.0/python/_brotli.c:486:3: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer.head’
brotli-1.2.0/python/_brotli.c:577:18: enter_function: entry to ‘brotli_Compressor_finish’
brotli-1.2.0/python/_brotli.c:581:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:585:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:585:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:590:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:591:9: call_function: calling ‘compress_stream’ from ‘brotli_Compressor_finish’
#  484|     }
#  485|   
#  486|->   Py_BEGIN_ALLOW_THREADS;
#  487|     while (1) {
#  488|       ok = BrotliEncoderCompressStream(enc, op, &available_in, &next_in,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
brotli-1.2.0/python/_brotli.c:488:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer.head’
brotli-1.2.0/python/_brotli.c:577:18: enter_function: entry to ‘brotli_Compressor_finish’
brotli-1.2.0/python/_brotli.c:581:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:585:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:585:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:590:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:591:9: call_function: calling ‘compress_stream’ from ‘brotli_Compressor_finish’
#  486|     Py_BEGIN_ALLOW_THREADS;
#  487|     while (1) {
#  488|->     ok = BrotliEncoderCompressStream(enc, op, &available_in, &next_in,
#  489|                                        &buffer.avail_out, &buffer.next_out, NULL);
#  490|       if (!ok) break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
brotli-1.2.0/python/_brotli.c:714:3: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer.head’
brotli-1.2.0/python/_brotli.c:659:18: enter_function: entry to ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:676:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:680:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:680:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:685:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:685:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:689:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:689:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:693:3: call_function: inlined call to ‘Buffer_Init’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:697:8: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:701:15: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:709:7: call_function: calling ‘Buffer_Grow’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:709:7: return_function: returning to ‘brotli_Decompressor_process’ from ‘Buffer_Grow’
brotli-1.2.0/python/_brotli.c:709:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:714:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:714:3: throw: if ‘PyEval_SaveThread’ throws an exception...
brotli-1.2.0/python/_brotli.c:714:3: danger: ‘buffer.head’ leaks here; was allocated at [(21)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/20)
#  712|     }
#  713|   
#  714|->   Py_BEGIN_ALLOW_THREADS;
#  715|     while (1) {
#  716|       result = BrotliDecoderDecompressStream(self->dec, &avail_in, &next_in,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
brotli-1.2.0/python/_brotli.c:716:14: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer.head’
brotli-1.2.0/python/_brotli.c:659:18: enter_function: entry to ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:676:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:680:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:680:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:685:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:685:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:689:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:689:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:693:3: call_function: inlined call to ‘Buffer_Init’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:697:8: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:701:15: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:709:7: call_function: calling ‘Buffer_Grow’ from ‘brotli_Decompressor_process’
brotli-1.2.0/python/_brotli.c:709:7: return_function: returning to ‘brotli_Decompressor_process’ from ‘Buffer_Grow’
brotli-1.2.0/python/_brotli.c:709:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:714:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:716:14: throw: if ‘BrotliDecoderDecompressStream’ throws an exception...
brotli-1.2.0/python/_brotli.c:716:14: danger: ‘buffer.head’ leaks here; was allocated at [(21)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/20)
#  714|     Py_BEGIN_ALLOW_THREADS;
#  715|     while (1) {
#  716|->     result = BrotliDecoderDecompressStream(self->dec, &avail_in, &next_in,
#  717|                                              &buffer.avail_out, &buffer.next_out,
#  718|                                              NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
brotli-1.2.0/python/_brotli.c:859:3: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer.head’
brotli-1.2.0/python/_brotli.c:821:18: enter_function: entry to ‘brotli_decompress’
brotli-1.2.0/python/_brotli.c:835:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:839:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:839:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:843:3: call_function: inlined call to ‘Buffer_Init’ from ‘brotli_decompress’
brotli-1.2.0/python/_brotli.c:849:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:854:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:854:7: call_function: calling ‘Buffer_Grow’ from ‘brotli_decompress’
brotli-1.2.0/python/_brotli.c:854:7: return_function: returning to ‘brotli_decompress’ from ‘Buffer_Grow’
brotli-1.2.0/python/_brotli.c:854:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:859:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:859:3: throw: if ‘PyEval_SaveThread’ throws an exception...
brotli-1.2.0/python/_brotli.c:859:3: danger: ‘buffer.head’ leaks here; was allocated at [(17)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/16)
#  857|     }
#  858|   
#  859|->   Py_BEGIN_ALLOW_THREADS;
#  860|     while (1) {
#  861|       result = BrotliDecoderDecompressStream(

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
brotli-1.2.0/python/_brotli.c:861:14: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer.head’
brotli-1.2.0/python/_brotli.c:821:18: enter_function: entry to ‘brotli_decompress’
brotli-1.2.0/python/_brotli.c:835:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:839:8: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:839:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:843:3: call_function: inlined call to ‘Buffer_Init’ from ‘brotli_decompress’
brotli-1.2.0/python/_brotli.c:849:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:854:7: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:854:7: call_function: calling ‘Buffer_Grow’ from ‘brotli_decompress’
brotli-1.2.0/python/_brotli.c:854:7: return_function: returning to ‘brotli_decompress’ from ‘Buffer_Grow’
brotli-1.2.0/python/_brotli.c:854:6: branch_false: following ‘false’ branch...
brotli-1.2.0/python/_brotli.c:859:3: branch_false: ...to here
brotli-1.2.0/python/_brotli.c:861:14: throw: if ‘BrotliDecoderDecompressStream’ throws an exception...
brotli-1.2.0/python/_brotli.c:861:14: danger: ‘buffer.head’ leaks here; was allocated at [(17)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/16)
#  859|     Py_BEGIN_ALLOW_THREADS;
#  860|     while (1) {
#  861|->     result = BrotliDecoderDecompressStream(
#  862|           state, &available_in, &next_in, &buffer.avail_out, &buffer.next_out, 0);
#  863|       if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {

Error: COMPILER_WARNING (CWE-686): [#def57]
brotli-1.2.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-a9gAdg/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
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.2.0-1.fc44
store-results-to/tmp/tmpz793igm_/brotli-1.2.0-1.fc44.tar.xz
time-created2026-01-08 15:42:47
time-finished2026-01-08 15:45:52
toolcsmock
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'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9