Task #40 - coreutils-9.4-6.fc40/scan-results.err
back to task #40download
Error: SHELLCHECK_WARNING (CWE-758): /etc/profile.d/colorls.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. # 1|-> # color-ls initialization # 2| # 3| # Skip all for noninteractive shells. Error: CLANG_WARNING: coreutils-9.4/gnulib-tests/strerror_r.c:165:7: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 163| # 164| { # 165|-> ret = 0; # 166| # 167| # if HAVE___XPG_STRERROR_R Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/cp.c:26: included_from: Included from here. coreutils-9.4/src/cp.c: scope_hint: In function 'decode_preserve_arg' coreutils-9.4/lib/argmatch.h:108:15: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(arg)' coreutils-9.4/src/cp.c:915:13: note: in expansion of macro 'XARGMATCH' coreutils-9.4/src/cp.c:915:13: note: in expansion of macro 'XARGMATCH' coreutils-9.4/src/cp.c:915:13: note: in expansion of macro 'XARGMATCH' coreutils-9.4/src/cp.c:915:13: note: in expansion of macro 'XARGMATCH' coreutils-9.4/src/cp.c:915:13: note: in expansion of macro 'XARGMATCH' # 106| # 107| # define XARGMATCH(Context, Arg, Arglist, Vallist) \ # 108|-> ((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \ # 109| (void const *) (Vallist), \ # 110| sizeof *(Vallist), \ Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/canon-host.c: scope_hint: In function 'canon_host_r' coreutils-9.4/lib/canon-host.c:75:27: warning[-Wanalyzer-malloc-leak]: leak of 'canon_host_r(host, & last_cherror)' # 73| says Darwin 7.9.0 getaddrinfo returns 0 but sets # 74| res->ai_canonname to NULL. */ # 75|-> retval = strdup (res->ai_canonname ? res->ai_canonname : host); # 76| if (!retval && cherror) # 77| *cherror = EAI_MEMORY; Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/canon-host.c:83:10: warning[-Wanalyzer-malloc-leak]: leak of 'canon_host_r(host, & last_cherror)' # 81| *cherror = status; # 82| # 83|-> return retval; # 84| } # 85| Error: CLANG_WARNING: coreutils-9.4/lib/canonicalize.c:387:15: warning[deadcode.DeadStores]: Value stored to 'name' is never read # 385| /* Careful here, end may be a pointer into extra_buf... */ # 386| memmove (&extra_buf[n], end, len + 1); # 387|-> name = end = memcpy (extra_buf, buf, n); # 388| end_in_extra_buffer = true; # 389| Error: COMPILER_WARNING (CWE-562): coreutils-9.4/lib/careadlinkat.c: scope_hint: In function 'careadlinkat.constprop' coreutils-9.4/lib/careadlinkat.c:180:10: warning[-Wreturn-local-addr]: function may return address of local variable # 180 | return readlink_stk (fd, filename, buffer, buffer_size, alloc, # | ^ coreutils-9.4/lib/careadlinkat.c:179:8: note: declared here # 179 | char stack_buf[STACK_BUF_SIZE]; # | ^ # 178| #endif # 179| char stack_buf[STACK_BUF_SIZE]; # 180|-> return readlink_stk (fd, filename, buffer, buffer_size, alloc, # 181| preadlinkat, stack_buf); # 182| } Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/exclude.c: scope_hint: In function 'add_exclude' coreutils-9.4/lib/exclude.c:565:20: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(pattern)' # 563| # 564| char *str = xstrdup (pattern); # 565|-> if ((options & (EXCLUDE_WILDCARDS | FNM_NOESCAPE)) == EXCLUDE_WILDCARDS) # 566| unescape_pattern (str); # 567| if (hash_insert (ex->head->v.table, str) != str) Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/file-set.c: scope_hint: In function 'record_file' coreutils-9.4/lib/file-set.c:43:8: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(24)' # 41| { # 42| struct F_triple *ent_from_table = hash_insert (ht, ent); # 43|-> if (ent_from_table == NULL) # 44| { # 45| /* Insertion failed due to lack of memory. */ Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/file-set.c:49:8: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(24)' # 47| } # 48| # 49|-> if (ent_from_table != ent) # 50| { # 51| /* There was already a matching entry in the table, so ENT was Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/fts.c:225: included_from: Included from here. coreutils-9.4/lib/fts-cycle.c: scope_hint: In function 'enter_dir' coreutils-9.4/lib/fts-cycle.c:94:10: warning[-Wanalyzer-malloc-leak]: leak of 'ad' coreutils-9.4/lib/fts.c:1245:22: note: in expansion of macro 'ISSET' coreutils-9.4/lib/fts.c:1307:34: note: in expansion of macro 'fts_opendir' coreutils-9.4/lib/fts.c:1330:19: note: in expansion of macro 'LEAVE_DIR' coreutils-9.4/lib/fts.c:1330:19: note: in expansion of macro 'LEAVE_DIR' coreutils-9.4/lib/fts.c:1330:19: note: in expansion of macro 'LEAVE_DIR' # 92| ad_from_table = hash_insert (fts->fts_cycle.ht, ad); # 93| # 94|-> if (ad_from_table != ad) # 95| { # 96| free (ad); Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/fts.c: scope_hint: In function 'filesystem_type' coreutils-9.4/lib/fts.c:714:12: warning[-Wanalyzer-malloc-leak]: leak of 't2' coreutils-9.4/lib/fts.c:743:13: note: in expansion of macro 'fts_assert' coreutils-9.4/lib/fts.c:743:13: note: in expansion of macro 'fts_assert' # 712| since the caller is not serious about performance. */ # 713| if (!ISSET (FTS_CWDFD)) # 714|-> return 0; # 715| # 716| if (! h) Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/fts.c: scope_hint: In function 'fts_build' coreutils-9.4/lib/fts.c:1307:16: warning[-Wanalyzer-malloc-leak]: leak of '**sp.fts_cur.fts_dirp' coreutils-9.4/lib/fts.c:1245:22: note: in expansion of macro 'ISSET' coreutils-9.4/lib/fts.c:1307:34: note: in expansion of macro 'fts_opendir' coreutils-9.4/lib/fts.c:1307:34: note: in expansion of macro 'fts_opendir' # 1305| /* Open the directory for reading. If this fails, we're done. # 1306| If being called from fts_read, set the fts_info field. */ # 1307|-> if ((cur->fts_dirp = fts_opendir(cur->fts_accpath, &dir_fd)) == NULL) # 1308| { # 1309| if (type == BREAD) Error: CLANG_WARNING: coreutils-9.4/lib/human.c:177:15: warning[deadcode.DeadStores]: Value stored to 'grouping' during its initialization is never read # 175| char const *decimal_point = "."; # 176| size_t decimal_pointlen = 1; # 177|-> char const *grouping = ""; # 178| char const *thousands_sep = ""; # 179| struct lconv const *l = localeconv (); Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/ialloc.h:57:37: warning[-Wanalyzer-malloc-leak]: leak of 'ximalloc(s + 1)' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'ximalloc' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'ximalloc' # 55| imalloc (idx_t s) # 56| { # 57|-> return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem (); # 58| } # 59| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/ialloc.h:57:37: warning[-Wanalyzer-malloc-leak]: leak of 'ximalloc(s)' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'ximalloc' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'ximalloc' # 55| imalloc (idx_t s) # 56| { # 57|-> return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem (); # 58| } # 59| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/ialloc.h:93:10: warning[-Wanalyzer-malloc-leak]: leak of 'xicalloc(s, 1)' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xicalloc' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xicalloc' # 91| s = 0; # 92| } # 93|-> return calloc (n, s); # 94| } # 95| Error: CPPCHECK_WARNING (CWE-664): coreutils-9.4/lib/long-options.c:76: error[va_end_missing]: va_list 'authors' was opened but not closed by va_end(). # 74| version_etc_va (stdout, command_name, package, version, authors); # 75| exit (EXIT_SUCCESS); # 76|-> } # 77| # 78| default: Error: CPPCHECK_WARNING (CWE-664): coreutils-9.4/lib/long-options.c:129: error[va_end_missing]: va_list 'authors' was opened but not closed by va_end(). # 127| version_etc_va (stdout, command_name, package, version, authors); # 128| exit (EXIT_SUCCESS); # 129|-> } # 130| # 131| default: Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/unexpand.c:42: included_from: Included from here. coreutils-9.4/lib/mbfile.h: scope_hint: In function 'unexpand' coreutils-9.4/lib/mbfile.h:85:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(max_column_width * 32)' coreutils-9.4/src/unexpand.c:125:3: note: in expansion of macro 'mbf_init' coreutils-9.4/src/unexpand.c:185:13: note: in expansion of macro 'mbf_getc' coreutils-9.4/src/unexpand.c:185:13: note: in expansion of macro 'mbf_getc' coreutils-9.4/src/unexpand.c:188:17: note: in expansion of macro 'mbf_init' # 83| /* If EOF has already been seen, don't use getc. This matters if # 84| mbf->fp is connected to an interactive tty. */ # 85|-> if (mbf->eof_seen) # 86| goto eof; # 87| Error: CPPCHECK_WARNING (CWE-758): coreutils-9.4/lib/mini-gmp.c:1513: error[shiftTooManyBits]: Shifting 64-bit value by 64 bits is undefined behaviour # 1511| { # 1512| int LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS; # 1513|-> while (x >>= LOCAL_GMP_LIMB_BITS) # 1514| { # 1515| ++ r->_mp_size; Error: CPPCHECK_WARNING (CWE-758): coreutils-9.4/lib/mini-gmp.c:1635: error[shiftTooManyBits]: Shifting 64-bit value by 64 bits is undefined behaviour # 1633| n = GMP_MIN (n, 1 + (mp_size_t) (GMP_ULONG_BITS - 1) / GMP_LIMB_BITS); # 1634| while (--n >= 0) # 1635|-> r = (r << LOCAL_GMP_LIMB_BITS) + u->_mp_d[n]; # 1636| return r; # 1637| } Error: CPPCHECK_WARNING (CWE-562): coreutils-9.4/lib/mktime.c:262: error[returnDanglingLifetime]: Returning pointer to local variable 'x' that will be invalid when returning. # 260| { # 261| __time64_t x = t; # 262|-> return convert (&x, tm); # 263| } # 264| 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: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/randint.c: scope_hint: In function 'randint_new' coreutils-9.4/lib/randint.c:76:10: warning[-Wanalyzer-malloc-leak]: leak of 'randint_new(randread_new(name, bytes_bound))' # 74| s->source = source; # 75| s->randnum = s->randmax = 0; # 76|-> return s; # 77| } # 78| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/randperm.c:146:1: warning[-Wanalyzer-malloc-leak]: leak of 'v1' # 144| # 145| v[i] = v1->val; # 146|-> } # 147| # 148| static void Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/randperm.c: scope_hint: In function 'sparse_swap' coreutils-9.4/lib/randperm.c:146:1: warning[-Wanalyzer-malloc-leak]: leak of 'v2' # 144| # 145| v[i] = v1->val; # 146|-> } # 147| # 148| static void Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/separate/lib/sys/stat.h:54: included_from: Included from here. coreutils-9.4/lib/read-file.c:23: included_from: Included from here. coreutils-9.4/lib/read-file.c: scope_hint: In function 'fread_file' coreutils-9.4/lib/read-file.c:62:57: warning[-Wanalyzer-malloc-leak]: leak of 'fread_file(rpl_fopen(filename, <unknown>), flags, length)' # 60| struct stat st; # 61| # 62|-> if (fstat (fileno (stream), &st) >= 0 && S_ISREG (st.st_mode)) # 63| { # 64| off_t pos = ftello (stream); Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/read-file.c:82:6: warning[-Wanalyzer-malloc-leak]: leak of 'fread_file(rpl_fopen(filename, <unknown>), flags, length)' # 80| } # 81| # 82|-> if (!(buf = malloc (alloc))) # 83| return NULL; /* errno is ENOMEM. */ # 84| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/read-file.c:104:30: warning[-Wanalyzer-malloc-leak]: leak of 'fread_file(rpl_fopen(filename, <unknown>), flags, length)' # 102| # 103| /* Shrink the allocated memory if possible. */ # 104|-> if (size < alloc - 1) # 105| { # 106| if (flags & RF_SENSITIVE) Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/read-file.c:142:43: warning[-Wanalyzer-malloc-leak]: leak of 'fread_file(rpl_fopen(filename, <unknown>), flags, length)' coreutils-9.4/lib/read-file.c: scope_hint: In function 'fread_file' coreutils-9.4/lib/read-file.c: scope_hint: In function 'fread_file' coreutils-9.4/lib/read-file.c:38: included_from: Included from here. # 140| } # 141| # 142|-> if (alloc < PTRDIFF_MAX - alloc / 2) # 143| alloc = alloc + alloc / 2; # 144| else 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: CLANG_WARNING: coreutils-9.4/lib/readutmp.c:249:8: warning[core.NullDereference]: Dereference of null pointer # 247| char *stringlim = (char *) a.utmp + a.alloc_bytes; # 248| char *p = stringlim - a.string_bytes; # 249|-> *--p = '\0'; /* NUL-terminate ut->ut_user */ # 250| ut->ut_user = p = memcpy (p - user_len, user, user_len); # 251| *--p = '\0'; /* NUL-terminate ut->ut_id */ Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/tsort.c:32: included_from: Included from here. coreutils-9.4/src/tsort.c: scope_hint: In function 'tsort' coreutils-9.4/lib/stdio--.h:30:18: warning[-Wanalyzer-malloc-leak]: leak of 'xzalloc(56)' coreutils-9.4/src/tsort.c:440:22: note: in expansion of macro 'freopen' coreutils-9.4/src/tsort.c: scope_hint: In function 'tsort' coreutils-9.4/src/tsort.c:440:22: note: in expansion of macro 'freopen' coreutils-9.4/src/tsort.c:440:22: note: in expansion of macro 'freopen' # 28| #if GNULIB_FREOPEN_SAFER # 29| # undef freopen # 30|-> # define freopen freopen_safer # 31| #endif # 32| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/time_rz.c: scope_hint: In function 'tzfree' coreutils-9.4/lib/time_rz.c:68:64: warning[-Wanalyzer-malloc-leak]: leak of 'tzalloc(getenv("TZ"))' coreutils-9.4/lib/time_rz.c:27: included_from: Included from here. coreutils-9.4/lib/time_rz.c:29: included_from: Included from here. # 66| { # 67| size_t name_size = name ? strlen (name) + 1 : 0; # 68|-> size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1; # 69| timezone_t tz = malloc (FLEXSIZEOF (struct tm_zone, abbrs, abbr_size)); # 70| if (tz) Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/time_rz.c: scope_hint: In function 'mktime_z' coreutils-9.4/lib/time_rz.c:211:12: warning[-Wanalyzer-malloc-leak]: leak of 'set_tz(tz)' # 209| if (env_tz # 210| ? tz->tz_is_set && strcmp (tz->abbrs, env_tz) == 0 # 211|-> : !tz->tz_is_set) # 212| return local_tz; # 213| else Error: CLANG_WARNING: coreutils-9.4/lib/time_rz.c:222:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'old_tz' # 220| int saved_errno = errno; # 221| tzfree (old_tz); # 222|-> errno = saved_errno; # 223| return NULL; # 224| } Error: CLANG_WARNING: coreutils-9.4/lib/time_rz.c:276:37: warning[unix.Malloc]: Potential leak of memory pointed to by 'old_tz' # 274| { # 275| bool abbr_saved = localtime_r (t, tm) && save_abbr (tz, tm); # 276|-> if (revert_tz (old_tz) && abbr_saved) # 277| return tm; # 278| } Error: CLANG_WARNING: coreutils-9.4/lib/time_rz.c:308:37: warning[unix.Malloc]: Potential leak of memory pointed to by 'old_tz' # 306| ok = ok && save_abbr (tz, &tm_1); # 307| #endif # 308|-> if (revert_tz (old_tz) && ok) # 309| { # 310| *tm = tm_1; Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xmalloc' coreutils-9.4/lib/xmalloc.c:45:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(n)' coreutils-9.4/lib/xmalloc.c:22: included_from: Included from here. coreutils-9.4/lib/xmalloc.c:57:10: note: in expansion of macro 'XNMALLOC' coreutils-9.4/lib/xmalloc.c:57:10: note: in expansion of macro 'XNMALLOC' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xmalloc' # 43| xmalloc (size_t s) # 44| { # 45|-> return nonnull (malloc (s)); # 46| } # 47| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/xmalloc.c:45:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(s)' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xmalloc' # 43| xmalloc (size_t s) # 44| { # 45|-> return nonnull (malloc (s)); # 46| } # 47| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xcalloc' coreutils-9.4/lib/xmalloc.c:298:10: warning[-Wanalyzer-malloc-leak]: leak of 'xcalloc(s, 1)' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xcalloc' # 296| xcalloc (size_t n, size_t s) # 297| { # 298|-> return nonnull (calloc (n, s)); # 299| } # 300| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xmemdup' coreutils-9.4/lib/xmalloc.c:314:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmemdup(string, strlen(string) + 1)' coreutils-9.4/lib/xmalloc.c: scope_hint: In function 'xmemdup' # 312| xmemdup (void const *p, size_t s) # 313| { # 314|-> return memcpy (xmalloc (s), p, s); # 315| } # 316| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/basenc.c: scope_hint: In function 'do_decode' 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/basenc.c:210:22: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(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/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/system.h:262: included_from: Included from here. coreutils-9.4/src/basenc.c:25: included_from: Included from here. coreutils-9.4/src/basenc.c: scope_hint: In function 'do_encode' coreutils-9.4/src/basenc.c:980:52: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)base_length(30720))' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' coreutils-9.4/src/basenc.c:995:11: note: in expansion of macro 'feof' coreutils-9.4/src/basenc.c: scope_hint: In function 'do_encode' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' # 978| do # 979| { # 980|-> n = fread (inbuf + sum, 1, ENC_BLOCKSIZE - sum, in); # 981| sum += n; # 982| } Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/system.h:262: included_from: Included from here. coreutils-9.4/src/basenc.c:25: included_from: Included from here. coreutils-9.4/src/basenc.c: scope_hint: In function 'do_encode' coreutils-9.4/src/basenc.c:980:52: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(40960)' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' coreutils-9.4/src/basenc.c:995:11: note: in expansion of macro 'feof' coreutils-9.4/src/basenc.c: scope_hint: In function 'do_encode' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' # 978| do # 979| { # 980|-> n = fread (inbuf + sum, 1, ENC_BLOCKSIZE - sum, in); # 981| sum += n; # 982| } Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/system.h:262: included_from: Included from here. coreutils-9.4/src/basenc.c:25: included_from: Included from here. coreutils-9.4/src/basenc.c: scope_hint: In function 'do_encode' coreutils-9.4/src/basenc.c:980:52: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(49152)' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' coreutils-9.4/src/basenc.c:995:11: note: in expansion of macro 'feof' coreutils-9.4/src/basenc.c: scope_hint: In function 'do_encode' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' # 978| do # 979| { # 980|-> n = fread (inbuf + sum, 1, ENC_BLOCKSIZE - sum, in); # 981| sum += n; # 982| } Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/basenc.c: scope_hint: In function 'do_decode' coreutils-9.4/src/basenc.c:1030:59: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(3072)' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' # 1028| { # 1029| idx_t n = fread (inbuf + sum, # 1030|-> 1, BASE_LENGTH (DEC_BLOCKSIZE) - sum, in); # 1031| # 1032| if (ignore_garbage) Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/basenc.c: scope_hint: In function 'do_decode' coreutils-9.4/src/basenc.c:1030:59: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(5120)' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' coreutils-9.4/lib/unlocked-io.h:92:46: note: in definition of macro 'fread' # 1028| { # 1029| idx_t n = fread (inbuf + sum, # 1030|-> 1, BASE_LENGTH (DEC_BLOCKSIZE) - sum, in); # 1031| # 1032| if (ignore_garbage) Error: CPPCHECK_WARNING (CWE-457): coreutils-9.4/src/blake2/blake2b-ref.c:96: warning[uninitvar]: Uninitialized variable: P->digest_length # 94| S->h[i] ^= load64( p + sizeof( S->h[i] ) * i ); # 95| # 96|-> S->outlen = P->digest_length; # 97| return 0; # 98| } Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/chown-core.c: scope_hint: In function 'uid_to_name' coreutils-9.4/src/chown-core.c:84:19: warning[-Wanalyzer-malloc-leak]: leak of 'uid_to_name(*file_stats.st_uid)' # 82| char buf[INT_BUFSIZE_BOUND (intmax_t)]; # 83| return xstrdup (TYPE_SIGNED (uid_t) ? imaxtostr (uid, buf) # 84|-> : umaxtostr (uid, buf)); # 85| } # 86| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/chown-core.c: scope_hint: In function 'gid_to_name' coreutils-9.4/src/chown-core.c:95:19: warning[-Wanalyzer-malloc-leak]: leak of 'gid_to_name(*file_stats.st_gid)' # 93| char buf[INT_BUFSIZE_BOUND (intmax_t)]; # 94| return xstrdup (TYPE_SIGNED (gid_t) ? imaxtostr (gid, buf) # 95|-> : umaxtostr (gid, buf)); # 96| } # 97| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/chown-core.c:106:28: warning[-Wanalyzer-malloc-leak]: leak of 'gid_to_name(*file_stats.st_gid)' # 104| { # 105| struct group *grp = getgrgid (gid); # 106|-> return grp ? xstrdup (grp->gr_name) : gid_to_str (gid); # 107| } # 108| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/chown-core.c: scope_hint: In function 'uid_to_name' coreutils-9.4/src/chown-core.c:117:28: warning[-Wanalyzer-malloc-leak]: leak of 'uid_to_name(*file_stats.st_uid)' # 115| { # 116| struct passwd *pwd = getpwuid (uid); # 117|-> return pwd ? xstrdup (pwd->pw_name) : uid_to_str (uid); # 118| } # 119| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/chown-core.c: scope_hint: In function 'describe_change' coreutils-9.4/src/chown-core.c:171:3: warning[-Wanalyzer-malloc-leak]: leak of 'user_group_str(<unknown>, <unknown>)' # 169| group ? old_group : nullptr); # 170| # 171|-> switch (changed) # 172| { # 173| case CH_SUCCEEDED: Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/chown-core.c:179:10: warning[-Wanalyzer-malloc-leak]: leak of 'user_group_str(<unknown>, <unknown>)' # 177| break; # 178| case CH_FAILED: # 179|-> if (old_spec) # 180| { # 181| fmt = (user ? _("failed to change ownership of %s from %s to %s\n") Error: GCC_ANALYZER_WARNING (CWE-476): coreutils-9.4/src/chroot.c: scope_hint: In function 'parse_additional_groups' coreutils-9.4/src/chroot.c:146:22: warning[-Wanalyzer-null-dereference]: dereference of NULL 'gids' coreutils-9.4/src/chroot.c:305:11: note: in expansion of macro 'uid_set' coreutils-9.4/src/chroot.c:27: included_from: Included from here. coreutils-9.4/lib/ignore-value.h:46:45: note: in definition of macro 'ignore_value' coreutils-9.4/lib/ignore-value.h:46:45: note: in definition of macro 'ignore_value' # 144| if (n_gids == n_gids_allocated) # 145| gids = X2NREALLOC (gids, &n_gids_allocated); # 146|-> gids[n_gids++] = value; # 147| } # 148| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/cp-hash.c: scope_hint: In function 'remember_copied' coreutils-9.4/src/cp-hash.c:126:6: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(24)' # 124| # 125| ent_from_table = hash_insert (src_to_dest, ent); # 126|-> if (ent_from_table == nullptr) # 127| { # 128| /* Insertion failed due to lack of memory. */ Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/cp-hash.c:135:6: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(24)' # 133| with a matching key. If so, free ENT (it wasn't inserted) and # 134| return the 'name' from the table entry. */ # 135|-> if (ent_from_table != ent) # 136| { # 137| src_to_dest_free (ent); Error: CLANG_WARNING: coreutils-9.4/src/cp.c:761:23: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value # 759| # 760| if (parents_option) # 761|-> ok &= re_protect (dst_name, arg_in_concat, target_dirfd, # 762| dst_relname, attr_list, x); # 763| } 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: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/csplit.c: scope_hint: In function 'get_new_buffer' coreutils-9.4/src/csplit.c:418:10: warning[-Wanalyzer-malloc-leak]: leak of 'get_new_buffer(bytes_wanted)' coreutils-9.4/src/system.h:29: included_from: Included from here. coreutils-9.4/src/csplit.c:27: included_from: Included from here. # 416| new_buffer->next = nullptr; # 417| # 418|-> return new_buffer; # 419| } # 420| Error: CLANG_WARNING: coreutils-9.4/src/csplit.c:576:21: warning[core.NullDereference]: Access to field 'start_line' results in a dereference of a null pointer (loaded from variable 'b') # 574| for (b = head;;) # 575| { # 576|-> if (linenum < b->start_line + b->num_lines) # 577| { # 578| /* The line is in this buffer. */ Error: CLANG_WARNING: coreutils-9.4/src/csplit.c:1367:22: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1365| } # 1366| # 1367|-> idx_t prefix_len = strlen (prefix); # 1368| idx_t max_digit_string_len # 1369| = (suffix Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/csplit.c: scope_hint: In function 'main' coreutils-9.4/src/csplit.c:1377:30: warning[-Wanalyzer-malloc-leak]: leak of 'ximalloc(__real__ <unknown>)' # 1375| filename_space = ximalloc (filename_size); # 1376| # 1377|-> set_input_file (argv[optind++]); # 1378| # 1379| parse_patterns (argc, optind, argv); Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/date.c: scope_hint: In function 'main' coreutils-9.4/src/date.c:315:32: warning[-Wanalyzer-malloc-leak]: leak of 'adjust_resolution(format)' # 313| char *copy = nullptr; # 314| # 315|-> for (char const *f = format; *f; f++) # 316| if (f[0] == '%') # 317| { Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/date.c: scope_hint: In function 'batch_convert' coreutils-9.4/src/date.c:392:10: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' coreutils-9.4/src/date.c:560:20: note: in expansion of macro 'DATE_FMT_LANGINFO' coreutils-9.4/src/date.c:20: included_from: Included from here. # 390| free (line); # 391| # 392|-> return ok; # 393| } # 394| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/date.c: scope_hint: In function 'main' coreutils-9.4/src/date.c:631:10: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 629| } # 630| # 631|-> if (! valid_date) # 632| error (EXIT_FAILURE, 0, _("invalid date %s"), quote (datestr)); # 633| Error: CLANG_WARNING: coreutils-9.4/src/dd.c:2514:19: warning[deadcode.DeadStores]: Value stored to 'exit_status' is never read # 2512| { # 2513| diagnose (errno, _("cannot fstat %s"), quoteaf (output_file)); # 2514|-> exit_status = EXIT_FAILURE; # 2515| } # 2516| else if (S_ISREG (stdout_stat.st_mode) Error: CLANG_WARNING: coreutils-9.4/src/dd.c:2525:19: warning[deadcode.DeadStores]: Value stored to 'exit_status' is never read # 2523| " in output file %s"), # 2524| isize, quoteaf (output_file)); # 2525|-> exit_status = EXIT_FAILURE; # 2526| } # 2527| } Error: CLANG_WARNING: coreutils-9.4/src/df.c:1170:47: warning[core.NullDereference]: Access to field 'total' results in a dereference of a null pointer (loaded from variable 'v') # 1168| case SIZE_FIELD: # 1169| case ITOTAL_FIELD: # 1170|-> cell = xstrdup (df_readable (false, v->total, buf, # 1171| v->input_units, v->output_units)); # 1172| break; Error: CLANG_WARNING: coreutils-9.4/src/df.c:1176:40: warning[core.NullDereference]: Access to field 'negate_used' results in a dereference of a null pointer (loaded from variable 'v') # 1174| case USED_FIELD: # 1175| case IUSED_FIELD: # 1176|-> cell = xstrdup (df_readable (v->negate_used, v->used, buf, # 1177| v->input_units, v->output_units)); # 1178| break; Error: CLANG_WARNING: coreutils-9.4/src/df.c:1182:40: warning[core.NullDereference]: Access to field 'negate_available' results in a dereference of a null pointer (loaded from variable 'v') # 1180| case AVAIL_FIELD: # 1181| case IAVAIL_FIELD: # 1182|-> cell = xstrdup (df_readable (v->negate_available, v->available, buf, # 1183| v->input_units, v->output_units)); # 1184| break; Error: CLANG_WARNING: coreutils-9.4/src/df.c:1190:32: warning[core.NullDereference]: Access to field 'used' results in a dereference of a null pointer (loaded from variable 'v') # 1188| { # 1189| double pct = -1; # 1190|-> if (! known_value (v->used) || ! known_value (v->available)) # 1191| ; # 1192| else if (!v->negate_used Error: CLANG_WARNING: coreutils-9.4/src/digest.c:1618:15: warning[core.CallAndMessage]: 8th function call argument is an uninitialized value # 1616| else # 1617| { # 1618|-> DIGEST_OUT (file, binary_file, bin_buffer, raw_digest, prefix_tag, # 1619| digest_delim, optind != argc, length); # 1620| } 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/expand-common.c:454:11: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 452| if (!ferror (fp)) # 453| err = 0; # 454|-> if (STREQ (prev_file, "-")) # 455| clearerr (fp); /* Also clear EOF. */ # 456| else if (fclose (fp) != 0) Error: CPPCHECK_WARNING (CWE-457): coreutils-9.4/src/factor.c:1387: error[uninitvar]: Uninitialized variable: q # 1385| return true; # 1386| # 1387|-> mpz_inits (q, a, nm1, tmp, nullptr); # 1388| # 1389| /* Precomputation for Miller-Rabin. */ Error: CPPCHECK_WARNING (CWE-457): coreutils-9.4/src/factor.c:1674: error[uninitvar]: Uninitialized variable: t # 1672| devmsg ("[pollard-rho (%lu)] ", a); # 1673| # 1674|-> mpz_inits (t, t2, nullptr); # 1675| mpz_init_set_si (y, 2); # 1676| mpz_init_set_si (x, 2); Error: CPPCHECK_WARNING (CWE-476): coreutils-9.4/src/head.c:382: warning[nullPointer]: Possible null pointer dereference: b # 380| if (! buffered_enough) # 381| { # 382|-> b[i] = xmalloc (READ_BUFSIZE); # 383| n_alloc = i + 1; # 384| } Error: CPPCHECK_WARNING (CWE-476): coreutils-9.4/src/head.c:385: warning[nullPointer]: Possible null pointer dereference: b # 383| n_alloc = i + 1; # 384| } # 385|-> n_read = full_read (fd, b[i], READ_BUFSIZE); # 386| if (n_read < READ_BUFSIZE) # 387| { Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/hostname.c: scope_hint: In function 'single_binary_main_hostname' coreutils-9.4/src/hostname.c:108:7: warning[-Wanalyzer-malloc-leak]: leak of 'xgethostname()' # 106| if (hostname == nullptr) # 107| error (EXIT_FAILURE, errno, _("cannot determine hostname")); # 108|-> puts (hostname); # 109| } # 110| 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: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/libstdbuf.c: scope_hint: In function 'apply_mode' coreutils-9.4/src/libstdbuf.c:129:6: warning[-Wanalyzer-malloc-leak]: leak of 'buf' # 127| } # 128| # 129|-> if (setvbuf (stream, buf, setvbuf_mode, size) != 0) # 130| { # 131| fprintf (stderr, _("could not set buffering of %s to mode %s\n"), Error: CLANG_WARNING: coreutils-9.4/src/libstdbuf.c:135:1: warning[unix.Malloc]: Potential leak of memory pointed to by 'buf' # 133| free (buf); # 134| } # 135|-> } # 136| # 137| /* Use __attribute to avoid elision of __attribute__ on SUNPRO_C etc. */ 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: CLANG_WARNING: coreutils-9.4/src/ls.c:5144:28: warning[core.DivideZero]: Division by zero # 5142| /* Calculate the number of rows that will be in each column except possibly # 5143| for a short column on the right. */ # 5144|-> size_t rows = cwd_n_used / cols + (cwd_n_used % cols != 0); # 5145| # 5146| for (row = 0; row < rows; row++) Error: CLANG_WARNING: coreutils-9.4/src/ls.c:5188:28: warning[core.DivideZero]: Division by zero # 5186| for (filesno = 1; filesno < cwd_n_used; ++filesno) # 5187| { # 5188|-> size_t col = filesno % cols; # 5189| # 5190| if (col == 0) Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/ls.c: scope_hint: In function 'init_column_info' coreutils-9.4/src/ls.c:5348:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 5346| } # 5347| # 5348|-> column_info_alloc = new_column_info_alloc; # 5349| } # 5350| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/ls.c:5360:1: warning[-Wanalyzer-malloc-leak]: leak of 'p' # 5358| column_info[i].col_arr[j] = MIN_COLUMN_WIDTH; # 5359| } # 5360|-> } # 5361| # 5362| /* Calculate the number of columns needed to represent the current set Error: CLANG_WARNING: coreutils-9.4/src/nl.c:396:11: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 394| return Text; # 395| if (len == header_del_len # 396|-> && !memcmp (line_buf.buffer, header_del, header_del_len)) # 397| return Header; # 398| if (len == body_del_len Error: CLANG_WARNING: coreutils-9.4/src/nl.c:399:11: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 397| return Header; # 398| if (len == body_del_len # 399|-> && !memcmp (line_buf.buffer, body_del, body_del_len)) # 400| return Body; # 401| if (len == footer_del_len Error: CLANG_WARNING: coreutils-9.4/src/nl.c:402:11: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 400| return Body; # 401| if (len == footer_del_len # 402|-> && !memcmp (line_buf.buffer, footer_del, footer_del_len)) # 403| return Footer; # 404| return Text; Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/nohup.c: scope_hint: In function 'single_binary_main_nohup' coreutils-9.4/src/nohup.c:163:18: warning[-Wanalyzer-malloc-leak]: leak of 'in_home' coreutils-9.4/src/system.h:72: included_from: Included from here. coreutils-9.4/src/nohup.c:24: included_from: Included from here. # 161| int saved_errno2 = errno; # 162| error (0, saved_errno, _("failed to open %s"), quoteaf (file)); # 163|-> if (in_home) # 164| error (0, saved_errno2, _("failed to open %s"), # 165| quoteaf (in_home)); Error: CPPCHECK_WARNING (CWE-415): coreutils-9.4/src/numfmt.c:874: error[doubleFree]: Memory pointed to by 't_string' is freed twice. # 872| } # 873| # 874|-> free (t_string); # 875| # 876| return n; Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/paste.c: scope_hint: In function 'paste_parallel' coreutils-9.4/src/paste.c:180:20: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(nfiles + 2)' coreutils-9.4/src/paste.c:43: included_from: Included from here. coreutils-9.4/src/paste.c:194:11: note: in expansion of macro 'STREQ' # 178| /* Streams open to the files to process; null if the corresponding # 179| stream is closed. */ # 180|-> FILE **fileptr = xnmalloc (nfiles + 1, sizeof *fileptr); # 181| # 182| /* Number of files still open to process. */ Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/paste.c:194:25: warning[-Wanalyzer-malloc-leak]: leak of 'xnmalloc(nfiles + 1, 8)' coreutils-9.4/src/paste.c:194:11: note: in expansion of macro 'STREQ' coreutils-9.4/src/paste.c:194:11: note: in expansion of macro 'STREQ' coreutils-9.4/src/paste.c:194:11: note: in expansion of macro 'STREQ' # 192| for (files_open = 0; files_open < nfiles; ++files_open) # 193| { # 194|-> if (STREQ (fnamptr[files_open], "-")) # 195| { # 196| have_read_stdin = true; Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/pinky.c: scope_hint: In function 'print_entry' coreutils-9.4/src/pinky.c:305:1: warning[-Wanalyzer-malloc-leak]: leak of 'host' coreutils-9.4/src/pinky.c:519:1: note: in expansion of macro 'main' coreutils-9.4/src/pinky.c:30: included_from: Included from here. coreutils-9.4/src/pinky.c:443:11: note: in expansion of macro 'IS_USER_PROCESS' coreutils-9.4/lib/dirname.h:29: included_from: Included from here. coreutils-9.4/src/system.h:265: included_from: Included from here. coreutils-9.4/src/pinky.c:26: included_from: Included from here. coreutils-9.4/lib/filename.h:93:23: note: in definition of macro 'ISSLASH' coreutils-9.4/src/pinky.c:204:7: note: in expansion of macro 'IS_ABSOLUTE_FILE_NAME' coreutils-9.4/src/system.h:262: included_from: Included from here. coreutils-9.4/src/pinky.c:291:7: note: in expansion of macro 'fputc' coreutils-9.4/src/pinky.c:304:3: note: in expansion of macro 'putchar' coreutils-9.4/src/pinky.c: scope_hint: In function 'print_entry' # 303| # 304| putchar ('\n'); # 305|-> } # 306| # 307| /* Display a verbose line of information about UTMP_ENT. */ Error: CLANG_WARNING: coreutils-9.4/src/pr.c:985:35: warning[core.NullDereference]: Array access (from variable 'file_names') results in a null pointer dereference # 983| if (! (first_page_number == 0 # 984| && *optarg == '+' && first_last_page (-2, '+', optarg + 1))) # 985|-> file_names[n_files++] = optarg; # 986| break; # 987| Error: CLANG_WARNING: coreutils-9.4/src/pr.c:1210:29: warning[core.NullDereference]: Array access (from variable 'file_names') results in a null pointer dereference # 1208| for (; optind < argc; optind++) # 1209| { # 1210|-> file_names[n_files++] = argv[optind]; # 1211| } # 1212| Error: GCC_ANALYZER_WARNING (CWE-688): coreutils-9.4/src/ptx.c: scope_hint: In function 'digest_word_file' coreutils-9.4/src/ptx.c:731:3: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected coreutils-9.4/src/ptx.c:1793:1: note: in expansion of macro 'main' coreutils-9.4/src/ptx.c: scope_hint: In function 'digest_word_file' coreutils-9.4/single/lib/stdlib.h:36: included_from: Included from here. coreutils-9.4/src/system.h:81: included_from: Included from here. /usr/include/stdlib.h:970:13: note: argument 1 of 'qsort' must be non-null # 729| /* Finally, sort all the words read. */ # 730| # 731|-> qsort (table->start, table->length, sizeof table->start[0], compare_words); # 732| } # 733| Error: CLANG_WARNING: coreutils-9.4/src/ptx.c:731:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 729| /* Finally, sort all the words read. */ # 730| # 731|-> qsort (table->start, table->length, sizeof table->start[0], compare_words); # 732| } # 733| Error: CLANG_WARNING: coreutils-9.4/src/selinux.c:314:22: warning[deadcode.DeadStores]: Although the value stored to 'ent' is used in the enclosing expression, the value is never actually read from 'ent' # 312| # 313| int err = 0; # 314|-> for (FTSENT *ent; (ent = fts_read (fts)); ) # 315| if (restorecon_private (selabel_handle, fts->fts_path) < 0) # 316| err = errno; Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/seq.c: scope_hint: In function 'seq_fast' coreutils-9.4/src/seq.c:480:11: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(inc_size + 1)' # 478| { # 479| q0 = xmalloc (inc_size + 1); # 480|-> q = memcpy (q0 + inc_size - q_len, b, q_len + 1); # 481| } # 482| else Error: CPPCHECK_WARNING (CWE-457): coreutils-9.4/src/sort.c:1159: warning[uninitvar]: Uninitialized variable: pid # 1157| } # 1158| # 1159|-> if (pid < 0) # 1160| { # 1161| saved_errno = errno; Error: CPPCHECK_WARNING (CWE-457): coreutils-9.4/src/sort.c:4724: warning[uninitvar]: Uninitialized variable: buf.buf # 4722| # 4723| finish: # 4724|-> free (buf.buf); # 4725| # 4726| if (! output_file_created) Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1503:30: warning[core.NullDereference]: Access to field 'c_cflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1501| { # 1502| if (reversed) # 1503|-> mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8; # 1504| else # 1505| mode->c_cflag = (mode->c_cflag & ~PARODD & ~CSIZE) | PARENB | CS7; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1505:30: warning[core.NullDereference]: Access to field 'c_cflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1503| mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8; # 1504| else # 1505|-> mode->c_cflag = (mode->c_cflag & ~PARODD & ~CSIZE) | PARENB | CS7; # 1506| } # 1507| else if (STREQ (info->name, "oddp")) Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1510:30: warning[core.NullDereference]: Access to field 'c_cflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1508| { # 1509| if (reversed) # 1510|-> mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8; # 1511| else # 1512| mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARODD | PARENB; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1512:30: warning[core.NullDereference]: Access to field 'c_cflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1510| mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8; # 1511| else # 1512|-> mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARODD | PARENB; # 1513| } # 1514| else if (STREQ (info->name, "nl")) Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1518:32: warning[core.NullDereference]: Access to field 'c_iflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1516| if (reversed) # 1517| { # 1518|-> mode->c_iflag = (mode->c_iflag | ICRNL) & ~INLCR & ~IGNCR; # 1519| mode->c_oflag = (mode->c_oflag # 1520| #ifdef ONLCR Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1534:31: warning[core.NullDereference]: Access to field 'c_iflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1532| else # 1533| { # 1534|-> mode->c_iflag = mode->c_iflag & ~ICRNL; # 1535| #ifdef ONLCR # 1536| mode->c_oflag = mode->c_oflag & ~ONLCR; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1542:30: warning[core.NullDereference]: Array access (via field 'c_cc') results in a null pointer dereference # 1540| else if (STREQ (info->name, "ek")) # 1541| { # 1542|-> mode->c_cc[VERASE] = CERASE; # 1543| mode->c_cc[VKILL] = CKILL; # 1544| } Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1550:27: warning[core.NullDereference]: Access to field 'c_lflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1548| { # 1549| if (reversed) # 1550|-> mode->c_lflag |= ICANON; # 1551| else # 1552| mode->c_lflag &= ~ICANON; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1552:27: warning[core.NullDereference]: Access to field 'c_lflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1550| mode->c_lflag |= ICANON; # 1551| else # 1552|-> mode->c_lflag &= ~ICANON; # 1553| } # 1554| else if (STREQ (info->name, "pass8")) Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1558:32: warning[core.NullDereference]: Access to field 'c_cflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1556| if (reversed) # 1557| { # 1558|-> mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARENB; # 1559| mode->c_iflag |= ISTRIP; # 1560| } Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1563:32: warning[core.NullDereference]: Access to field 'c_cflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1561| else # 1562| { # 1563|-> mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8; # 1564| mode->c_iflag &= ~ISTRIP; # 1565| } Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1571:32: warning[core.NullDereference]: Access to field 'c_cflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1569| if (reversed) # 1570| { # 1571|-> mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARENB; # 1572| mode->c_iflag |= ISTRIP; # 1573| mode->c_oflag |= OPOST; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1577:32: warning[core.NullDereference]: Access to field 'c_cflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1575| else # 1576| { # 1577|-> mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8; # 1578| mode->c_iflag &= ~ISTRIP; # 1579| mode->c_oflag &= ~OPOST; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1588:29: warning[core.NullDereference]: Access to field 'c_iflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1586| { # 1587| /* Cooked mode. */ # 1588|-> mode->c_iflag |= BRKINT | IGNPAR | ISTRIP | ICRNL | IXON; # 1589| mode->c_oflag |= OPOST; # 1590| mode->c_lflag |= ISIG | ICANON; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1601:29: warning[core.NullDereference]: Access to field 'c_iflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1599| { # 1600| /* Raw mode. */ # 1601|-> mode->c_iflag = 0; # 1602| mode->c_oflag &= ~OPOST; # 1603| mode->c_lflag &= ~(ISIG | ICANON Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1616:27: warning[core.NullDereference]: Access to field 'c_iflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1614| { # 1615| if (reversed) # 1616|-> mode->c_iflag |= IXANY; # 1617| else # 1618| mode->c_iflag &= ~IXANY; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1618:27: warning[core.NullDereference]: Access to field 'c_iflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1616| mode->c_iflag |= IXANY; # 1617| else # 1618|-> mode->c_iflag &= ~IXANY; # 1619| } # 1620| #endif Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1625:30: warning[core.NullDereference]: Access to field 'c_oflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1623| { # 1624| if (reversed) # 1625|-> mode->c_oflag = (mode->c_oflag & ~TABDLY) | TAB3; # 1626| else # 1627| mode->c_oflag = (mode->c_oflag & ~TABDLY) | TAB0; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1627:30: warning[core.NullDereference]: Access to field 'c_oflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1625| mode->c_oflag = (mode->c_oflag & ~TABDLY) | TAB3; # 1626| else # 1627|-> mode->c_oflag = (mode->c_oflag & ~TABDLY) | TAB0; # 1628| } # 1629| #else Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1646:29: warning[core.NullDereference]: Access to field 'c_lflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1644| if (reversed) # 1645| { # 1646|-> mode->c_lflag &= ~XCASE; # 1647| mode->c_iflag &= ~IUCLC; # 1648| mode->c_oflag &= ~OLCUC; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1652:29: warning[core.NullDereference]: Access to field 'c_lflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1650| else # 1651| { # 1652|-> mode->c_lflag |= XCASE; # 1653| mode->c_iflag |= IUCLC; # 1654| mode->c_oflag |= OLCUC; Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1659:23: warning[core.NullDereference]: Access to field 'c_lflag' results in a dereference of a null pointer (loaded from variable 'mode') # 1657| #endif # 1658| else if (STREQ (info->name, "crt")) # 1659|-> mode->c_lflag |= ECHOE # 1660| #ifdef ECHOCTL # 1661| | ECHOCTL Error: CLANG_WARNING: coreutils-9.4/src/stty.c:1669:29: warning[core.NullDereference]: Array access (via field 'c_cc') results in a null pointer dereference # 1667| else if (STREQ (info->name, "dec")) # 1668| { # 1669|-> mode->c_cc[VINTR] = 3; /* ^C */ # 1670| mode->c_cc[VERASE] = 127; /* DEL */ # 1671| mode->c_cc[VKILL] = 21; /* ^U */ Error: CLANG_WARNING: coreutils-9.4/src/stty.c:2284:42: warning[core.NullDereference]: Array access (via field 'c_cc') results in a null pointer dereference # 2282| break; # 2283| #endif # 2284|-> mode->c_cc[control_info[i].offset] = control_info[i].saneval; # 2285| } # 2286| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/df.c:29: included_from: Included from here. coreutils-9.4/src/df.c: scope_hint: In function 'decode_output_arg' coreutils-9.4/src/system.h:194:22: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(arg)' coreutils-9.4/src/df.c:453:15: note: in expansion of macro 'STREQ' coreutils-9.4/src/df.c:453:15: note: in expansion of macro 'STREQ' coreutils-9.4/lib/assure.h:23: included_from: Included from here. coreutils-9.4/src/df.c:30: included_from: Included from here. coreutils-9.4/src/df.c:426:3: note: in expansion of macro 'affirm' coreutils-9.4/src/df.c:453:15: note: in expansion of macro 'STREQ' coreutils-9.4/src/df.c:453:15: note: in expansion of macro 'STREQ' # 192| } # 193| # 194|-> #define STREQ(a, b) (strcmp (a, b) == 0) # 195| #define STREQ_LEN(a, b, n) (strncmp (a, b, n) == 0) /* n==-1 means unbounded */ # 196| #define STRPREFIX(a, b) (strncmp (a, b, strlen (b)) == 0) Error: CLANG_WARNING: coreutils-9.4/src/tail.c:837:35: warning[core.NullDereference]: Access to field 'nbytes' results in a dereference of a null pointer (loaded from variable 'tmp') # 835| /* Run through the list, printing characters. First, skip over unneeded # 836| buffers. */ # 837|-> for (tmp = first; total_bytes - tmp->nbytes > n_bytes; tmp = tmp->next) # 838| total_bytes -= tmp->nbytes; # 839| Error: CPPCHECK_WARNING (CWE-758): coreutils-9.4/src/tail.c:2380: warning[objectIndex]: The address of local variable 'dummy_stdin' might be accessed at non-zero index. # 2378| # 2379| for (i = 0; i < n_files; i++) # 2380|-> if (STREQ (file[i], "-")) # 2381| found_hyphen = true; # 2382| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/tee.c: scope_hint: In function 'tee_files' coreutils-9.4/src/tee.c:255:3: warning[-Wanalyzer-malloc-leak]: leak of 'xnmalloc((long unsigned int)(nfiles + 1), 8)' coreutils-9.4/lib/gettext.h:26: included_from: Included from here. coreutils-9.4/src/system.h:172: included_from: Included from here. coreutils-9.4/src/tee.c:24: included_from: Included from here. coreutils-9.4/src/tee.c:254:24: note: in expansion of macro '_' coreutils-9.4/src/system.h:741: included_from: Included from here. coreutils-9.4/separate/lib/error.h:408:28: note: in definition of macro '__gl_error_call' coreutils-9.4/src/tee.c:266:11: note: in expansion of macro 'error' coreutils-9.4/separate/lib/error.h:470:7: note: in expansion of macro '__gl_error_call' coreutils-9.4/src/tee.c:266:11: note: in expansion of macro 'error' coreutils-9.4/separate/lib/error.h:412:10: note: in expansion of macro '__gl_error_call1' coreutils-9.4/separate/lib/error.h:470:7: note: in expansion of macro '__gl_error_call' coreutils-9.4/src/tee.c:266:11: note: in expansion of macro 'error' # 253| out_pollable[0] = iopoll_output_ok (fileno (descriptors[0])); # 254| files[0] = bad_cast (_("standard output")); # 255|-> setvbuf (stdout, nullptr, _IONBF, 0); # 256| n_outputs++; # 257| Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/tee.c:261:37: warning[-Wanalyzer-malloc-leak]: leak of 'xnmalloc((long unsigned int)(nfiles + 1), 8)' coreutils-9.4/src/tee.c:254:24: note: in expansion of macro '_' coreutils-9.4/separate/lib/error.h:408:28: note: in definition of macro '__gl_error_call' coreutils-9.4/src/tee.c:266:11: note: in expansion of macro 'error' coreutils-9.4/separate/lib/error.h:470:7: note: in expansion of macro '__gl_error_call' coreutils-9.4/src/tee.c:266:11: note: in expansion of macro 'error' coreutils-9.4/separate/lib/error.h:412:10: note: in expansion of macro '__gl_error_call1' coreutils-9.4/separate/lib/error.h:470:7: note: in expansion of macro '__gl_error_call' coreutils-9.4/src/tee.c:266:11: note: in expansion of macro 'error' # 259| { # 260| /* Do not treat "-" specially - as mandated by POSIX. */ # 261|-> descriptors[i] = fopen (files[i], mode_string); # 262| if (descriptors[i] == nullptr) # 263| { Error: CPPCHECK_WARNING (CWE-401): coreutils-9.4/src/temp-stream.c:96: error[memleakOnRealloc]: Common realloc mistake: 'tempbuf' nulled but not freed upon failure # 94| while (true) # 95| { # 96|-> if (! (tempbuf = realloc (tempbuf, tempbuf_len))) # 97| { # 98| error (0, errno, _("failed to make temporary file name")); Error: CLANG_WARNING: coreutils-9.4/src/tr.c:1816:21: warning[core.NullDereference]: Access to field 'state' results in a dereference of a null pointer (loaded from variable 's2') # 1814| # 1815| set_initialize (s1, false, in_s1); # 1816|-> s2->state = BEGIN_STATE; # 1817| for (int i = 0; i < N_CHARS; i++) # 1818| xlate[i] = i; Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/tsort.c:422:6: warning[-Wanalyzer-malloc-leak]: leak of 'xzalloc(56)' coreutils-9.4/src/tsort.c: scope_hint: In function 'tsort' coreutils-9.4/src/tsort.c: scope_hint: In function 'tsort' # 420| walk_tree (struct item *root, bool (*action) (struct item *)) # 421| { # 422|-> if (root->right) # 423| recurse_tree (root->right, action); # 424| } Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/tsort.c:443:3: warning[-Wanalyzer-malloc-leak]: leak of 'xzalloc(56)' coreutils-9.4/src/tsort.c: scope_hint: In function 'tsort' coreutils-9.4/lib/assure.h:23: included_from: Included from here. coreutils-9.4/src/tsort.c:28: included_from: Included from here. coreutils-9.4/src/tsort.c:458:7: note: in expansion of macro 'affirm' # 441| error (EXIT_FAILURE, errno, "%s", quotef (file)); # 442| # 443|-> fadvise (stdin, FADVISE_SEQUENTIAL); # 444| # 445| init_tokenbuffer (&tokenbuffer); Error: CLANG_WARNING: coreutils-9.4/src/unexpand.c:275:19: warning[deadcode.DeadStores]: Value stored to 'next_tab_column' is never read # 273| next tab stop. */ # 274| column -= !!column; # 275|-> next_tab_column = column; # 276| tab_index -= !!tab_index; # 277| } 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 Error: COMPILER_WARNING: coreutils-9.4/src/wc_avx2.c: scope_hint: In function 'wc_lines_avx2' coreutils-9.4/src/wc_avx2.c:55:15: warning[-Wpsabi]: AVX vector return without AVX enabled changes the ABI # 53| Intel Xeon E3-1231v3. Maybe on a newer CPU with additional vector # 54| execution engines it would be a win. */ # 55|-> accumulator = _mm256_setzero_si256 (); # 56| accumulator2 = _mm256_setzero_si256 (); # 57| zeroes = _mm256_setzero_si256 (); Error: CLANG_WARNING: coreutils-9.4/src/who.c:400:16: warning[core.NullDereference]: Dereference of null pointer # 398| } # 399| char *p = hoststr; # 400|-> *p++ = '('; # 401| p = stpcpy (p, host); # 402| *p++ = ':'; Error: GCC_ANALYZER_WARNING (CWE-401): coreutils-9.4/src/who.c: scope_hint: In function 'print_user' coreutils-9.4/src/who.c:433:1: warning[-Wanalyzer-malloc-leak]: leak of 'host' coreutils-9.4/src/who.c:686:1: note: in expansion of macro 'main' coreutils-9.4/lib/dirname.h:29: included_from: Included from here. coreutils-9.4/src/system.h:265: included_from: Included from here. coreutils-9.4/src/who.c:32: included_from: Included from here. coreutils-9.4/lib/filename.h:93:23: note: in definition of macro 'ISSLASH' coreutils-9.4/src/who.c:340:7: note: in expansion of macro 'IS_ABSOLUTE_FILE_NAME' coreutils-9.4/src/who.c:29: included_from: Included from here. # 431| time_string (utmp_ent), idlestr, pidstr, # 432| hoststr ? hoststr : "", ""); # 433|-> } # 434| # 435| static void