Task #9484 - coreutils-9.5-9.fc41/run0/scan-results.err
back to task #9484download
Error: COMPILER_WARNING (CWE-562):
coreutils-9.5-build/coreutils-9.5/lib/careadlinkat.c: scope_hint: In function 'careadlinkat.constprop'
coreutils-9.5-build/coreutils-9.5/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.5-build/coreutils-9.5/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: CPPCHECK_WARNING (CWE-664):
coreutils-9.5-build/coreutils-9.5/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.5-build/coreutils-9.5/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: CPPCHECK_WARNING (CWE-758):
coreutils-9.5-build/coreutils-9.5/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.5-build/coreutils-9.5/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.5-build/coreutils-9.5/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-457):
coreutils-9.5-build/coreutils-9.5/src/digest.c:1148: error[uninitvar]: Uninitialized variable: bin_buffer_unaligned
# 1146| unsigned char bin_buffer_unaligned[DIGEST_BIN_BYTES + DIGEST_ALIGN];
# 1147| /* Make sure bin_buffer is properly aligned. */
# 1148|-> unsigned char *bin_buffer = ptr_align (bin_buffer_unaligned, DIGEST_ALIGN);
# 1149| uintmax_t line_number;
# 1150| char *line;
Error: CPPCHECK_WARNING (CWE-457):
coreutils-9.5-build/coreutils-9.5/src/digest.c:1348: error[uninitvar]: Uninitialized variable: bin_buffer_unaligned
# 1346| unsigned char bin_buffer_unaligned[DIGEST_BIN_BYTES + DIGEST_ALIGN];
# 1347| /* Make sure bin_buffer is properly aligned. */
# 1348|-> unsigned char *bin_buffer = ptr_align (bin_buffer_unaligned, DIGEST_ALIGN);
# 1349| bool do_check = false;
# 1350| int opt;
Error: CPPCHECK_WARNING (CWE-758):
coreutils-9.5-build/coreutils-9.5/src/factor.c:466: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 464| return (a << 1) + 1;
# 465|
# 466|-> bgta = HIGHBIT_TO_MASK (t);
# 467|
# 468| /* b <-- min (a, b) */
Error: CPPCHECK_WARNING (CWE-457):
coreutils-9.5-build/coreutils-9.5/src/factor.c:1392: error[uninitvar]: Uninitialized variable: q
# 1390| return true;
# 1391|
# 1392|-> mpz_inits (q, a, nm1, tmp, nullptr);
# 1393|
# 1394| /* Precomputation for Miller-Rabin. */
Error: CPPCHECK_WARNING (CWE-457):
coreutils-9.5-build/coreutils-9.5/src/factor.c:1679: error[uninitvar]: Uninitialized variable: t
# 1677| devmsg ("[pollard-rho (%lu)] ", a);
# 1678|
# 1679|-> mpz_inits (t, t2, nullptr);
# 1680| mpz_init_set_si (y, 2);
# 1681| mpz_init_set_si (x, 2);
Error: CPPCHECK_WARNING (CWE-476):
coreutils-9.5-build/coreutils-9.5/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.5-build/coreutils-9.5/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: CPPCHECK_WARNING (CWE-415):
coreutils-9.5-build/coreutils-9.5/src/numfmt.c:863: error[doubleFree]: Memory pointed to by 't_string' is freed twice.
# 861| }
# 862|
# 863|-> free (t_string);
# 864|
# 865| return n;
Error: CPPCHECK_WARNING (CWE-457):
coreutils-9.5-build/coreutils-9.5/src/sort.c:1089: warning[uninitvar]: Uninitialized variable: pid
# 1087| }
# 1088|
# 1089|-> if (pid < 0)
# 1090| {
# 1091| saved_errno = errno;
Error: CPPCHECK_WARNING (CWE-457):
coreutils-9.5-build/coreutils-9.5/src/sort.c:4133: warning[uninitvar]: Uninitialized variable: buf.buf
# 4131|
# 4132| finish:
# 4133|-> free (buf.buf);
# 4134|
# 4135| if (! output_file_created)
Error: CPPCHECK_WARNING (CWE-758):
coreutils-9.5-build/coreutils-9.5/src/tail.c:2402: warning[objectIndex]: The address of variable 'dummy_stdin' might be accessed at non-zero index.
# 2400|
# 2401| for (i = 0; i < n_files; i++)
# 2402|-> if (STREQ (file[i], "-"))
# 2403| found_hyphen = true;
# 2404|
Error: CPPCHECK_WARNING (CWE-401):
coreutils-9.5-build/coreutils-9.5/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"));