Task #52028 - fixed.err
back to task #52028download
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/gnulib-tests/localename.c:2716:10: warning[-Wanalyzer-malloc-leak]: leak of 'new_node'
grep-3.11/gnulib-tests/localename.c:2690:5: acquire_memory: allocated here
grep-3.11/gnulib-tests/localename.c:2691:6: branch_false: following 'false' branch (when 'new_node' is non-NULL)...
grep-3.11/gnulib-tests/localename.c:2694:11: branch_false: ...to here
grep-3.11/gnulib-tests/localename.c:2716:10: danger: 'new_node' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 2714| if (mt) gl_lock_unlock (struniq_lock);
# 2715| }
# 2716|-> return new_node->contents;
# 2717| }
# 2718|
Error: CPPCHECK_WARNING (CWE-758):
grep-3.11/lib/malloc/dynarray_emplace_enlarge.c:59: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 57|
# 58| size_t new_size;
# 59|-> if (INT_MULTIPLY_WRAPV (new_allocated, element_size, &new_size))
# 60| return false;
# 61| void *new_array;
Error: CPPCHECK_WARNING (CWE-758):
grep-3.11/lib/malloc/dynarray_resize.c:45: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 43|
# 44| size_t new_size_bytes;
# 45|-> if (INT_MULTIPLY_WRAPV (size, element_size, &new_size_bytes))
# 46| {
# 47| /* Overflow. */
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/lib/obstack.c:138: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 136| if (!chunk)
# 137| (*obstack_alloc_failed_handler) ();
# 138|-> h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,
# 139| alignment - 1);
# 140| h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size;
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/lib/obstack.c:208: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 206| /* Compute an aligned object_base in the new chunk */
# 207| object_base =
# 208|-> __PTR_ALIGN ((char *) new_chunk, new_chunk->contents, h->alignment_mask);
# 209|
# 210| /* Move the existing object to the new chunk. */
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/lib/obstack.c:218: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 216| if (!h->maybe_empty_object
# 217| && (h->object_base
# 218|-> == __PTR_ALIGN ((char *) old_chunk, old_chunk->contents,
# 219| h->alignment_mask)))
# 220| {
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/lib/propername.c:59:10: warning[-Wanalyzer-malloc-leak]: leak of 'trim2(sub, 2)'
grep-3.11/lib/propername.c:187:1: enter_function: entry to 'proper_name_utf8'
grep-3.11/lib/propername.c:200:6: branch_false: following 'false' branch...
grep-3.11/lib/propername.c:247:10: branch_false: ...to here
grep-3.11/lib/propername.c:254:6: branch_true: following 'true' branch (when the strings are non-equal)...
grep-3.11/lib/propername.c:257:11: branch_true: ...to here
grep-3.11/lib/propername.c:257:11: call_function: calling 'mbsstr_trimmed_wordbounded' from 'proper_name_utf8'
# 57| bool found = false;
# 58|
# 59|-> for (; *string != '\0';)
# 60| {
# 61| const char *tsub_in_string = mbsstr (string, tsub);
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/lib/striconv.c:299:31: warning[-Wanalyzer-malloc-leak]: leak of 'str_cd_iconv(src, iconv_open(to_codeset, from_codeset))'
grep-3.11/lib/striconv.c:393:1: enter_function: entry to 'str_iconv'
grep-3.11/lib/striconv.c:395:6: branch_false: following 'false' branch...
grep-3.11/lib/striconv.c:420:10: branch_false: following 'false' branch...
grep-3.11/lib/striconv.c:423:16: branch_false: ...to here
grep-3.11/lib/striconv.c:423:16: acquire_memory: allocated here
grep-3.11/lib/striconv.c:423:16: call_function: calling 'str_cd_iconv' from 'str_iconv'
# 297| else if (errno == E2BIG)
# 298| {
# 299|-> size_t used = outptr - result;
# 300| size_t newsize = result_size * 2;
# 301| char *newresult;
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/lib/striconv.c:338:31: warning[-Wanalyzer-malloc-leak]: leak of 'str_cd_iconv(src, iconv_open(to_codeset, from_codeset))'
grep-3.11/lib/striconv.c:393:1: enter_function: entry to 'str_iconv'
grep-3.11/lib/striconv.c:395:6: branch_false: following 'false' branch...
grep-3.11/lib/striconv.c:420:10: branch_false: following 'false' branch...
grep-3.11/lib/striconv.c:423:16: branch_false: ...to here
grep-3.11/lib/striconv.c:423:16: acquire_memory: allocated here
grep-3.11/lib/striconv.c:423:16: call_function: calling 'str_cd_iconv' from 'str_iconv'
# 336| if (errno == E2BIG)
# 337| {
# 338|-> size_t used = outptr - result;
# 339| size_t newsize = result_size * 2;
# 340| char *newresult;
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/lib/striconv.c:367:6: warning[-Wanalyzer-malloc-leak]: leak of 'str_cd_iconv(src, iconv_open(to_codeset, from_codeset))'
grep-3.11/lib/striconv.c:393:1: enter_function: entry to 'str_iconv'
grep-3.11/lib/striconv.c:395:6: branch_false: following 'false' branch...
grep-3.11/lib/striconv.c:420:10: branch_false: following 'false' branch...
grep-3.11/lib/striconv.c:423:16: branch_false: ...to here
grep-3.11/lib/striconv.c:423:16: acquire_memory: allocated here
grep-3.11/lib/striconv.c:423:16: call_function: calling 'str_cd_iconv' from 'str_iconv'
# 365|
# 366| /* Add the terminating NUL byte. */
# 367|-> *outptr++ = '\0';
# 368|
# 369| length = outptr - result;
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/lib/striconv.c:420:10: warning[-Wanalyzer-malloc-leak]: leak of 'iconv_open(to_codeset, from_codeset)'
grep-3.11/lib/striconv.c:395:6: branch_false: following 'false' branch...
grep-3.11/lib/striconv.c:419:12: acquire_memory: allocated here
grep-3.11/lib/striconv.c:420:10: danger: 'iconv_open(to_codeset, from_codeset)' leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 418| # endif
# 419| cd = iconv_open (to_codeset, from_codeset);
# 420|-> if (cd == (iconv_t) -1)
# 421| return NULL;
# 422|
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/lib/xmalloc.c:45:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(n)'
grep-3.11/lib/xmalloc.c:55:1: enter_function: entry to 'xcharalloc'
grep-3.11/lib/xmalloc.c:57:10: call_function: calling 'xmalloc' from 'xcharalloc'
# 43| xmalloc (size_t s)
# 44| {
# 45|-> return nonnull (malloc (s));
# 46| }
# 47|
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/lib/xmalloc.c:45:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(s)'
grep-3.11/lib/xmalloc.c:312:1: enter_function: entry to 'xmemdup'
grep-3.11/lib/xmalloc.c:314:18: call_function: calling 'xmalloc' from 'xmemdup'
# 43| xmalloc (size_t s)
# 44| {
# 45|-> return nonnull (malloc (s));
# 46| }
# 47|
Error: GCC_ANALYZER_WARNING (CWE-401):
grep-3.11/lib/xmalloc.c:298:10: warning[-Wanalyzer-malloc-leak]: leak of 'xcalloc(s, 1)'
grep-3.11/lib/xmalloc.c:281:1: enter_function: entry to 'xzalloc'
grep-3.11/lib/xmalloc.c:283:10: call_function: calling 'xcalloc' from 'xzalloc'
# 296| xcalloc (size_t n, size_t s)
# 297| {
# 298|-> return nonnull (calloc (n, s));
# 299| }
# 300|
Error: CPPCHECK_WARNING (CWE-758):
grep-3.11/lib/xstrtol.c:54: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 52| {
# 53| __strtol_t scaled;
# 54|-> if (INT_MULTIPLY_WRAPV (*x, scale_factor, &scaled))
# 55| {
# 56| *x = *x < 0 ? TYPE_MINIMUM (__strtol_t) : TYPE_MAXIMUM (__strtol_t);
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/src/kwset.c:137: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 135| obstack_init (&kwset->obstack);
# 136| kwset->words = 0;
# 137|-> kwset->trie = obstack_alloc (&kwset->obstack, sizeof *kwset->trie);
# 138| kwset->trie->accepting = 0;
# 139| kwset->trie->links = NULL;
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/src/kwset.c:200: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 198| if (!cur)
# 199| {
# 200|-> cur = obstack_alloc (&kwset->obstack, sizeof *cur);
# 201| cur->llink = NULL;
# 202| cur->rlink = NULL;
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/src/kwset.c:203: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 201| cur->llink = NULL;
# 202| cur->rlink = NULL;
# 203|-> cur->trie = obstack_alloc (&kwset->obstack, sizeof *cur->trie);
# 204| cur->trie->accepting = 0;
# 205| cur->trie->links = NULL;
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/src/kwset.c:423: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 421|
# 422| /* Looking for just one string. Extract it from the trie. */
# 423|-> kwset->target = obstack_alloc (&kwset->obstack, kwset->mind);
# 424| curr = kwset->trie;
# 425| for (idx_t i = 0; i < kwset->mind; i++)
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/src/kwset.c:533: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 531| {
# 532| /* Looking for just one string. Extract it from the trie. */
# 533|-> kwset->target = obstack_alloc (&kwset->obstack, kwset->mind);
# 534| curr = kwset->trie;
# 535| for (idx_t i = kwset->mind; 0 < i; i--)
Error: CPPCHECK_WARNING (CWE-682):
grep-3.11/src/kwset.c:546: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 544| backwards match has failed. Extract it from the trie. */
# 545| kwset->shift
# 546|-> = obstack_alloc (&kwset->obstack,
# 547| sizeof *kwset->shift * (kwset->mind - 1));
# 548| curr = kwset->trie->next;