Task #1631 - fixed.err
back to task #1631download
Error: CPPCHECK_WARNING (CWE-682):
coreutils-9.4/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):
coreutils-9.4/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):
coreutils-9.4/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: CPPCHECK_WARNING (CWE-682):
coreutils-9.4/lib/readtokens0.c:55: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 53| /* Don't count the trailing NUL byte in the length. */
# 54| size_t len = obstack_object_size (&t->o_data) - 1;
# 55|-> char const *s = obstack_finish (&t->o_data);
# 56| obstack_ptr_grow (&t->o_tok, s);
# 57| obstack_grow (&t->o_tok_len, &len, sizeof len);
Error: CLANG_WARNING:
coreutils-9.4/lib/readtokens0.c:87:7: warning[core.NullDereference]: Dereference of null pointer
# 85| }
# 86|
# 87|-> obstack_1grow (&t->o_data, c);
# 88| if (c == '\0')
# 89| save_token (t);
Error: CPPCHECK_WARNING (CWE-682):
coreutils-9.4/lib/readtokens0.c:96: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 94| obstack_ptr_grow (&t->o_tok, NULL);
# 95|
# 96|-> t->tok = obstack_finish (&t->o_tok);
# 97| t->tok_len = obstack_finish (&t->o_tok_len);
# 98| return ! ferror (in);
Error: CPPCHECK_WARNING (CWE-682):
coreutils-9.4/lib/readtokens0.c:97: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 95|
# 96| t->tok = obstack_finish (&t->o_tok);
# 97|-> t->tok_len = obstack_finish (&t->o_tok_len);
# 98| return ! ferror (in);
# 99| }
Error: GCC_ANALYZER_WARNING (CWE-401):
coreutils-9.4/src/basenc.c:210:22: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)base_length(4200))'
coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread'
coreutils-9.4/src/basenc.c:1030:31: note: in expansion of macro 'BASE_LENGTH'
coreutils-9.4/src/basenc.c:1029:21: note: in expansion of macro 'fread'
coreutils-9.4/src/basenc.c: scope_hint: In function 'do_decode'
coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread'
coreutils-9.4/src/basenc.c:1030:31: note: in expansion of macro 'BASE_LENGTH'
# 208|
# 209|
# 210|-> # define BASE_LENGTH base_length
# 211|
# 212| /* Note that increasing this may decrease performance if --ignore-garbage
Error: GCC_ANALYZER_WARNING (CWE-401):
coreutils-9.4/src/cp.c: scope_hint: In function 'do_copy'
coreutils-9.4/src/cp.c:819:10: warning[-Wanalyzer-malloc-leak]: leak of 'dest'
coreutils-9.4/src/cp.c:25: included_from: Included from here.
coreutils-9.4/src/cp.c:799:14: note: in expansion of macro 'STREQ'
# 817| }
# 818|
# 819|-> return ok;
# 820| }
# 821|
Error: CPPCHECK_WARNING (CWE-682):
coreutils-9.4/src/dircolors.c:520: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 518| {
# 519| size_t len = obstack_object_size (&lsc_obstack);
# 520|-> char *s = obstack_finish (&lsc_obstack);
# 521| char const *prefix;
# 522| char const *suffix;
Error: GCC_ANALYZER_WARNING (CWE-401):
coreutils-9.4/src/env.c: scope_hint: In function 'parse_signal_action_params.part.0'
coreutils-9.4/src/env.c:565:10: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(optarg)'
# 563| if (signum == 0)
# 564| error (0, 0, _("%s: invalid signal"), quote (opt_sig));
# 565|-> if (signum <= 0)
# 566| usage (exit_failure);
# 567|
Error: GCC_ANALYZER_WARNING (CWE-401):
coreutils-9.4/src/env.c:568:14: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(optarg)'
# 566| usage (exit_failure);
# 567|
# 568|-> signals[signum] = set_default ? DEFAULT : IGNORE;
# 569|
# 570| opt_sig = strtok (nullptr, ",");
Error: GCC_ANALYZER_WARNING (CWE-401):
coreutils-9.4/src/env.c: scope_hint: In function 'parse_block_signal_params.part.0'
coreutils-9.4/src/env.c:654:10: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(optarg)'
# 652| if (signum == 0)
# 653| error (0, 0, _("%s: invalid signal"), quote (opt_sig));
# 654|-> if (signum <= 0)
# 655| usage (exit_failure);
# 656|
Error: CLANG_WARNING:
coreutils-9.4/src/join.c:344:13: warning[deadcode.DeadStores]: Value stored to 'sep' during its initialization is never read
# 342| if (tab != NULL)
# 343| {
# 344|-> char *sep = ptr;
# 345| for (; ptr < lim; ptr = sep + mblength)
# 346| {
Error: CLANG_WARNING:
coreutils-9.4/src/join.c:385:13: warning[deadcode.DeadStores]: Value stored to 'mblength' is never read
# 383| if (mblength == (size_t)-1 || mblength == (size_t)-2)
# 384| {
# 385|-> mblength = 1;
# 386| state = state_bak;
# 387| break;
Error: CLANG_WARNING:
coreutils-9.4/src/join.c:403:8: warning[deadcode.DeadStores]: Value stored to 'mblength' is never read
# 401| if (mblength == (size_t)-1 || mblength == (size_t)-2)
# 402| {
# 403|-> mblength = 1;
# 404| state = state_bak;
# 405| break;
Error: CLANG_WARNING:
coreutils-9.4/src/join.c:416:5: warning[deadcode.DeadStores]: Value stored to 'mblength' is never read
# 414| if (mblength == (size_t)-1 || mblength == (size_t)-2)
# 415| {
# 416|-> mblength = 1;
# 417| state = state_bak;
# 418| break;
Error: CLANG_WARNING:
coreutils-9.4/src/join.c:436:8: warning[deadcode.DeadStores]: Value stored to 'mblength' is never read
# 434| if (mblength == (size_t)-1 || mblength == (size_t)-2)
# 435| {
# 436|-> mblength = 1;
# 437| state = state_bak;
# 438| break;
Error: CLANG_WARNING:
coreutils-9.4/src/join.c:449:5: warning[deadcode.DeadStores]: Value stored to 'mblength' is never read
# 447| if (mblength == (size_t)-1 || mblength == (size_t)-2)
# 448| {
# 449|-> mblength = 1;
# 450| state = state_bak;
# 451| break;
Error: CPPCHECK_WARNING (CWE-682):
coreutils-9.4/src/ls.c:1082: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1080| if (n_pos > 0)
# 1081| {
# 1082|-> off_t *pos = obstack_finish (os);
# 1083| fputs (prefix, stdout);
# 1084| for (size_t i = 0; i < n_pos; i++)
Error: GCC_ANALYZER_WARNING (CWE-401):
coreutils-9.4/src/wc.c: scope_hint: In function 'single_binary_main_wc'
coreutils-9.4/src/wc.c:724:29: warning[-Wanalyzer-malloc-leak]: leak of 'get_input_fstatus(nfiles, files)'
coreutils-9.4/src/wc.c:778:1: note: in expansion of macro 'main'
# 722| get_input_fstatus (size_t nfiles, char *const *file)
# 723| {
# 724|-> struct fstatus *fstatus = xnmalloc (nfiles ? nfiles : 1, sizeof *fstatus);
# 725|
# 726| if (nfiles == 0