elfutils-0.191-5.fc41
List of Defects
Error: SHELLCHECK_WARNING (CWE-758): [#def1]
/etc/profile.d/debuginfod.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
# 1|-> # $HOME/.profile* or similar files may first set $DEBUGINFOD_URLS.
# 2| # If $DEBUGINFOD_URLS is not set there, we set it from system *.url files.
# 3| # $HOME/.*rc or similar files may then amend $DEBUGINFOD_URLS.
Error: SHELLCHECK_WARNING (CWE-563): [#def2]
/etc/profile.d/debuginfod.sh:8:5: warning[SC2034]: prefix appears unused. Verify use (or export if used externally).
# 6|
# 7| if [ -z "$DEBUGINFOD_URLS" ]; then
# 8|-> prefix="/usr"
# 9| DEBUGINFOD_URLS=$(cat /dev/null "/etc/debuginfod"/*.urls 2>/dev/null | tr '\n' ' ' || :)
# 10| [ -n "$DEBUGINFOD_URLS" ] && export DEBUGINFOD_URLS || unset DEBUGINFOD_URLS
Error: SHELLCHECK_WARNING (CWE-477): [#def3]
/usr/bin/eu-make-debug-archive:71:46: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
# 69| done
# 70|
# 71|-> if [ $kernel = no ] && [ $force_kernel = yes -o -n "$sudo" ]; then
# 72| usage
# 73| fi
Error: SHELLCHECK_WARNING (CWE-477): [#def4]
/usr/bin/eu-make-debug-archive:95:27: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
# 93| # Without --force, bail if the kernel installation is not newer.
# 94| # This file is normally touched by installing new kernels or modules.
# 95|-> if [ $force_kernel = no -a "$archive" -nt "$dep" ]; then
# 96| exit 0
# 97| fi
Error: SHELLCHECK_WARNING: [#def5]
/usr/bin/eu-make-debug-archive:95:41: warning[SC3013]: In POSIX sh, -nt is undefined.
# 93| # Without --force, bail if the kernel installation is not newer.
# 94| # This file is normally touched by installing new kernels or modules.
# 95|-> if [ $force_kernel = no -a "$archive" -nt "$dep" ]; then
# 96| exit 0
# 97| fi
Error: CLANG_WARNING: [#def6]
elfutils-0.191/debuginfod/debuginfod-client.c:323:18: warning[core.UndefinedBinaryOperatorResult]: The right operand of '-' is a garbage value
# 321|
# 322| /* Check timestamp of interval file to see whether cleaning is necessary. */
# 323|-> if (time(NULL) - st.st_mtime < clean_interval)
# 324| /* Interval has not passed, skip cleaning. */
# 325| return 0;
Error: CLANG_WARNING: [#def7]
elfutils-0.191/debuginfod/debuginfod-client.c:1285:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
# 1283| /*The beginning of goto block query_in_parallel.*/
# 1284| query_in_parallel:
# 1285|-> rc = -ENOENT; /* Reset rc to default.*/
# 1286|
# 1287| /* Initialize handle_data with default values. */
Error: CLANG_WARNING: [#def8]
elfutils-0.191/debuginfod/debuginfod-client.c:1828:10: warning[core.NullDereference]: Array access (from variable 'server_url_list') results in a null pointer dereference
# 1826| out1:
# 1827| for (int i = 0; i < num_urls; ++i)
# 1828|-> free(server_url_list[i]);
# 1829| free(server_url_list);
# 1830|
Error: GCC_ANALYZER_WARNING (CWE-121): [#def9]
/usr/include/bits/sigstksz.h:24: included_from: Included from here.
/usr/include/signal.h:328: included_from: Included from here.
/usr/include/sys/param.h:28: included_from: Included from here.
elfutils-0.191/lib/system.h:47: included_from: Included from here.
elfutils-0.191/libdw/memory-access.h:35: included_from: Included from here.
elfutils-0.191/libdw/libdwP.h:684: included_from: Included from here.
elfutils-0.191/libdwfl/libdwflP.h:41: included_from: Included from here.
elfutils-0.191/libdwfl/image-header.c:34: included_from: Included from here.
elfutils-0.191/lib/system.h: scope_hint: In function ‘pread_retry’
elfutils-0.191/lib/system.h:192:41: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
elfutils-0.191/lib/system.h:192:41: note: write of 496 bytes to beyond the end of ‘header_buffer’
elfutils-0.191/lib/system.h:192:41: note: valid subscripts for ‘header_buffer’ are ‘[0]’ to ‘[591]’
/usr/include/unistd.h:389:16: note: parameter 2 of ‘pread’ marked with attribute ‘access (write_only, 2, 3)’
# 190| do
# 191| {
# 192|-> ssize_t ret = TEMP_FAILURE_RETRY (pread (fd, ((char *)buf) + recvd, len - recvd,
# 193| off + recvd));
# 194| if (ret <= 0)
Error: CPPCHECK_WARNING (CWE-457): [#def10]
elfutils-0.191/libcpu/i386_data.h:250: error[uninitvar]: Uninitialized variable: &p
# 248| int p;
# 249| n = snprintf (tmpbuf, sizeof (tmpbuf), "%s0x%" PRIx32 "(%%%n%s)",
# 250|-> disp < 0 ? "-" : "", disp < 0 ? -disp : disp, &p,
# 251| #ifdef X86_64
# 252| (prefixes & has_rex_b) ? hiregs[modrm & 7] :
Error: CLANG_WARNING: [#def11]
elfutils-0.191/libcpu/riscv_disasm.c:1439:22: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value due to array index out of bounds
# 1437|
# 1438| case 'o':
# 1439|-> if (op[prec - 1] != NULL)
# 1440| {
# 1441| if (deferred_start != NULL)
Error: CPPCHECK_WARNING (CWE-401): [#def12]
elfutils-0.191/libdw/cfi.c:78: error[memleak]: Memory leak: bigger
# 76| {
# 77| *result = DWARF_E_NOMEM;
# 78|-> return false;
# 79| }
# 80| else
Error: CPPCHECK_WARNING (CWE-401): [#def13]
elfutils-0.191/libdw/cfi.c:471: error[memleak]: Memory leak: cie_fs
# 469| Dwarf_Frame *cie_fs = calloc (1, sizeof (Dwarf_Frame));
# 470| if (unlikely (cie_fs == NULL))
# 471|-> return DWARF_E_NOMEM;
# 472|
# 473| /* If the default state of any register is not "undefined"
Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
elfutils-0.191/libdw/cie.c: scope_hint: In function ‘intern_new_cie’
elfutils-0.191/libdw/cie.c:147:6: warning[-Wanalyzer-malloc-leak]: leak of ‘cie’
# 145|
# 146| /* Add the new entry to the search tree. */
# 147|-> if (tsearch (cie, &cache->cie_tree, &compare_cie) == NULL)
# 148| {
# 149| free (cie);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
elfutils-0.191/libdw/dwarf_cu_dwp_section_info.c: scope_hint: In function ‘__libdw_package_index.part.0’
elfutils-0.191/libdw/dwarf_cu_dwp_section_info.c:47:27: warning[-Wanalyzer-malloc-leak]: leak of ‘__libdw_read_package_index(dbg, (int)tu)’
elfutils-0.191/libdw/dwarf_cu_dwp_section_info.c:33: included_from: Included from here.
# 45|
# 46| /* We need at least 16 bytes for the header. */
# 47|-> if (data == NULL || data->d_size < 16)
# 48| {
# 49| invalid:
Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
elfutils-0.191/libdw/dwarf_getalt.c: scope_hint: In function ‘find_debug_altlink’
elfutils-0.191/libdw/dwarf_getalt.c:150:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
/usr/include/bits/sigstksz.h:24: included_from: Included from here.
/usr/include/signal.h:328: included_from: Included from here.
/usr/include/sys/param.h:28: included_from: Included from here.
elfutils-0.191/lib/system.h:47: included_from: Included from here.
elfutils-0.191/libdw/memory-access.h:35: included_from: Included from here.
elfutils-0.191/libdw/libdwP.h:684: included_from: Included from here.
elfutils-0.191/libdw/dwarf_getalt.c:33: included_from: Included from here.
# 148| }
# 149|
# 150|-> if (fd >= 0)
# 151| {
# 152| Dwarf *alt = dwarf_begin (fd, O_RDONLY);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
elfutils-0.191/libdw/dwarf_getalt.c:156:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
# 154| {
# 155| dbg->alt_dwarf = alt;
# 156|-> dbg->alt_fd = fd;
# 157| }
# 158| else
Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
elfutils-0.191/libdw/dwarf_getcfi_elf.c: scope_hint: In function ‘dwarf_getcfi_elf’
elfutils-0.191/libdw/dwarf_getcfi_elf.c:282:16: warning[-Wanalyzer-malloc-leak]: leak of ‘getcfi_shdr(elf, gelf_getehdr(elf, & ehdr_mem))’
# 280| }
# 281|
# 282|-> if (shstrndx != 0)
# 283| {
# 284| Elf_Scn *hdr_scn = NULL;
Error: CLANG_WARNING: [#def19]
elfutils-0.191/libdw/dwarf_getcfi_elf.c:336:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'result'
# 334| result = getcfi_phdr (elf, ehdr);
# 335|
# 336|-> return result;
# 337| }
# 338| INTDEF (dwarf_getcfi_elf)
Error: CLANG_WARNING: [#def20]
elfutils-0.191/libdw/dwarf_getsrc_file.c:94:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'match'
# 92| if (lastfile >= line->files->nfiles)
# 93| {
# 94|-> __libdw_seterrno (DWARF_E_INVALID_DWARF);
# 95| return -1;
# 96| }
Error: CLANG_WARNING: [#def21]
elfutils-0.191/libdw/dwarf_ranges.c:536:11: warning[core.NullDereference]: Access to field 'd_buf' results in a dereference of a null pointer (loaded from variable 'd')
# 534| }
# 535|
# 536|-> readp = d->d_buf + offset;
# 537| readendp = d->d_buf + d->d_size;
# 538|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
elfutils-0.191/libdw/libdw_alloc.c: scope_hint: In function ‘__libdw_allocate’
elfutils-0.191/libdw/libdw_alloc.c:137:10: warning[-Wanalyzer-malloc-leak]: leak of ‘newp’
# 135| pthread_rwlock_unlock (&dbg->mem_rwl);
# 136|
# 137|-> return (void *) result;
# 138| }
# 139|
Error: CLANG_WARNING: [#def23]
elfutils-0.191/libdwfl/argp-std.c:216:16: warning[deadcode.DeadStores]: Although the value stored to 'dwfl' is used in the enclosing expression, the value is never actually read from 'dwfl'
# 214| Dwfl *dwfl = opt->dwfl;
# 215| if (dwfl == NULL)
# 216|-> opt->dwfl = dwfl = INTUSE(dwfl_begin) (&offline_callbacks);
# 217| /* Permit -e and --core together. */
# 218| else if (dwfl->callbacks != &offline_callbacks)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
elfutils-0.191/libdwfl/core-file.c: scope_hint: In function ‘dwfl_core_file_report’
elfutils-0.191/libdwfl/core-file.c:479:10: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(executable)’
# 477| }
# 478| dwfl->user_core->executable_for_core = strdup (executable);
# 479|-> if (dwfl->user_core->executable_for_core == NULL)
# 480| {
# 481| if (cleanup_user_core)
Error: CPPCHECK_WARNING (CWE-401): [#def25]
elfutils-0.191/libdwfl/cu.c:63: error[memleak]: Memory leak: aranges
# 61| aranges = malloc (naranges * sizeof *aranges);
# 62| if (unlikely (aranges == NULL))
# 63|-> return DWFL_E_NOMEM;
# 64|
# 65| /* libdw has sorted its list by address, which is how we want it.
Error: CPPCHECK_WARNING (CWE-401): [#def26]
elfutils-0.191/libdwfl/cu.c:213: error[memleak]: Memory leak: cu
# 211| struct dwfl_cu *cu = malloc (sizeof *cu);
# 212| if (unlikely (cu == NULL))
# 213|-> return DWFL_E_NOMEM;
# 214|
# 215| cu->mod = mod;
Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
elfutils-0.191/libdwfl/dwfl_build_id_find_elf.c: scope_hint: In function ‘dwfl_build_id_find_elf’
elfutils-0.191/libdwfl/dwfl_build_id_find_elf.c:198:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
/usr/include/bits/sigstksz.h:24: included_from: Included from here.
/usr/include/signal.h:328: included_from: Included from here.
/usr/include/sys/param.h:28: included_from: Included from here.
elfutils-0.191/lib/system.h:47: included_from: Included from here.
elfutils-0.191/libdw/memory-access.h:35: included_from: Included from here.
elfutils-0.191/libdw/libdwP.h:684: included_from: Included from here.
elfutils-0.191/libdwfl/libdwflP.h:41: included_from: Included from here.
elfutils-0.191/libdwfl/dwfl_build_id_find_elf.c:33: included_from: Included from here.
# 196| debuginfo-server if enabled. */
# 197| if (fd < 0 && mod->build_id_len > 0)
# 198|-> fd = __libdwfl_debuginfod_find_executable (mod->dwfl,
# 199| mod->build_id_bits,
# 200| mod->build_id_len);
Error: CPPCHECK_WARNING (CWE-401): [#def28]
elfutils-0.191/libdwfl/dwfl_module_build_id.c:50: error[memleak]: Memory leak: copy
# 48| {
# 49| __libdwfl_seterrno (DWFL_E_NOMEM);
# 50|-> return -1;
# 51| }
# 52|
Error: CPPCHECK_WARNING (CWE-401): [#def29]
elfutils-0.191/libdwfl/dwfl_module_build_id.c:56: error[memleak]: Memory leak: copy
# 54| mod->build_id_vaddr = vaddr;
# 55| mod->build_id_len = len;
# 56|-> return len;
# 57| }
# 58|
Error: CLANG_WARNING: [#def30]
elfutils-0.191/libdwfl/dwfl_module_getsrc_file.c:79:11: warning[deadcode.DeadStores]: Although the value stored to 'error' is used in the enclosing expression, the value is never actually read from 'error'
# 77| struct dwfl_cu *cu = NULL;
# 78| Dwfl_Error error;
# 79|-> while ((error = __libdwfl_nextcu (mod, cu, &cu)) == DWFL_E_NOERROR
# 80| && cu != NULL
# 81| && (error = __libdwfl_cu_getsrclines (cu)) == DWFL_E_NOERROR)
Error: CLANG_WARNING: [#def31]
elfutils-0.191/libdwfl/dwfl_module_getsrc_file.c:81:7: warning[deadcode.DeadStores]: Although the value stored to 'error' is used in the enclosing expression, the value is never actually read from 'error'
# 79| while ((error = __libdwfl_nextcu (mod, cu, &cu)) == DWFL_E_NOERROR
# 80| && cu != NULL
# 81|-> && (error = __libdwfl_cu_getsrclines (cu)) == DWFL_E_NOERROR)
# 82| {
# 83| /* Search through all the line number records for a matching
Error: CPPCHECK_WARNING (CWE-401): [#def32]
elfutils-0.191/libdwfl/dwfl_module_report_build_id.c:71: error[memleak]: Memory leak: copy
# 69| {
# 70| __libdwfl_seterrno (DWFL_E_NOMEM);
# 71|-> return -1;
# 72| }
# 73| memcpy (copy, bits, len);
Error: CPPCHECK_WARNING (CWE-401): [#def33]
elfutils-0.191/libdwfl/elf-from-memory.c:77: error[memleak]: Memory leak: buffer
# 75| no_memory:
# 76| __libdwfl_seterrno (DWFL_E_NOMEM);
# 77|-> return NULL;
# 78| }
# 79|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def34]
elfutils-0.191/libdwfl/find-debuginfo.c:48:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘try_open(&main_stat, dir, subdir, file, & fname)’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
/usr/include/bits/sigstksz.h:24: included_from: Included from here.
/usr/include/signal.h:328: included_from: Included from here.
/usr/include/sys/param.h:28: included_from: Included from here.
elfutils-0.191/lib/system.h:47: included_from: Included from here.
elfutils-0.191/libdw/memory-access.h:35: included_from: Included from here.
elfutils-0.191/libdw/libdwP.h:684: included_from: Included from here.
elfutils-0.191/libdwfl/libdwflP.h:41: included_from: Included from here.
elfutils-0.191/libdwfl/find-debuginfo.c:33: included_from: Included from here.
# 46| {
# 47| char *fname;
# 48|-> if (dir == NULL && subdir == NULL)
# 49| {
# 50| fname = strdup (debuglink);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
elfutils-0.191/libdwfl/find-debuginfo.c:48:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘try_open(&main_stat, dir, ".dwz", xbasename(file), &fname)’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/libdwfl/libdwflP.h:36: included_from: Included from here.
# 46| {
# 47| char *fname;
# 48|-> if (dir == NULL && subdir == NULL)
# 49| {
# 50| fname = strdup (debuglink);
Error: CPPCHECK_WARNING (CWE-401): [#def36]
elfutils-0.191/libdwfl/find-debuginfo.c:52: error[memleak]: Memory leak: fname
# 50| fname = strdup (debuglink);
# 51| if (unlikely (fname == NULL))
# 52|-> return -1;
# 53| }
# 54| else if ((subdir == NULL ? asprintf (&fname, "%s/%s", dir, debuglink)
Error: CPPCHECK_WARNING (CWE-401): [#def37]
elfutils-0.191/libdwfl/find-debuginfo.c:186: error[memleak]: Memory leak: localname
# 184| localname = malloc (len + sizeof ".debug");
# 185| if (unlikely (localname == NULL))
# 186|-> return -1;
# 187| memcpy (localname, file_basename, len);
# 188| memcpy (&localname[len], ".debug", sizeof ".debug");
Error: CPPCHECK_WARNING (CWE-401): [#def38]
elfutils-0.191/libdwfl/find-debuginfo.c:202: error[memleak]: Memory leak: localpath
# 200| {
# 201| free (localname);
# 202|-> return -1;
# 203| }
# 204|
Error: GCC_ANALYZER_WARNING (CWE-688): [#def39]
elfutils-0.191/libdwfl/find-debuginfo.c:271:24: warning[-Wanalyzer-null-argument]: use of NULL ‘subdir’ where non-null expected
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
# 269| at a time. */
# 270| explore_dir:
# 271|-> subdir = strchr (subdir, '/');
# 272| if (subdir != NULL)
# 273| subdir = subdir + 1;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
elfutils-0.191/libdwfl/find-debuginfo.c: scope_hint: In function ‘find_debuginfo_in_path’
elfutils-0.191/libdwfl/find-debuginfo.c:345:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fname’
elfutils-0.191/config.h:218: included_from: Included from here.
elfutils-0.191/libdwfl/find-debuginfo.c:30: included_from: Included from here.
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
# 343| free (file_dirname);
# 344| return -1;
# 345|-> }
# 346|
# 347| int
Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
elfutils-0.191/libdwfl/frame_unwind.c: scope_hint: In function ‘do_push’
elfutils-0.191/libdwfl/frame_unwind.c:111:11: warning[-Wanalyzer-malloc-leak]: leak of ‘new_addrs’
elfutils-0.191/config.h:218: included_from: Included from here.
elfutils-0.191/libdwfl/frame_unwind.c:30: included_from: Included from here.
elfutils-0.191/lib/eu-config.h:179:23: note: in definition of macro ‘INTUSE’
elfutils-0.191/lib/eu-config.h:179:23: note: in definition of macro ‘INTUSE’
elfutils-0.191/libdwelf/libdwelfP.h:34: included_from: Included from here.
elfutils-0.191/libdwfl/libdwflP.h:42: included_from: Included from here.
elfutils-0.191/libdwfl/frame_unwind.c:35: included_from: Included from here.
elfutils-0.191/libdwfl/frame_unwind.c:153:33: note: in definition of macro ‘push’
elfutils-0.191/libdwfl/frame_unwind.c:264:17: note: in expansion of macro ‘push’
elfutils-0.191/lib/system.h:47: included_from: Included from here.
elfutils-0.191/libdw/memory-access.h:35: included_from: Included from here.
elfutils-0.191/libdw/libdwP.h:684: included_from: Included from here.
elfutils-0.191/libdw/cfi.h:32: included_from: Included from here.
elfutils-0.191/libdwfl/frame_unwind.c:33: included_from: Included from here.
# 109| if (new_addrs == NULL)
# 110| {
# 111|-> __libdwfl_seterrno (DWFL_E_NOMEM);
# 112| return false;
# 113| }
Error: GCC_ANALYZER_WARNING (CWE-416): [#def42]
elfutils-0.191/libdwfl/frame_unwind.c: scope_hint: In function ‘expr_eval’
elfutils-0.191/libdwfl/frame_unwind.c:313:41: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘frame’
elfutils-0.191/lib/eu-config.h:179:23: note: in definition of macro ‘INTUSE’
elfutils-0.191/lib/eu-config.h:179:23: note: in definition of macro ‘INTUSE’
elfutils-0.191/libdwfl/frame_unwind.c:204:20: note: in expansion of macro ‘push’
elfutils-0.191/libdwfl/frame_unwind.c:204:20: note: in expansion of macro ‘push’
elfutils-0.191/libdwfl/frame_unwind.c:204:20: note: in expansion of macro ‘push’
elfutils-0.191/libdwfl/frame_unwind.c:304:17: note: in expansion of macro ‘pop’
elfutils-0.191/libdwfl/frame_unwind.c:304:17: note: in expansion of macro ‘pop’
elfutils-0.191/libdwfl/frame_unwind.c:304:17: note: in expansion of macro ‘pop’
# 311| if (op->atom == DW_OP_deref_size)
# 312| {
# 313|-> const int elfclass = frame->cache->e_ident[EI_CLASS];
# 314| const unsigned addr_bytes = elfclass == ELFCLASS32 ? 4 : 8;
# 315| if (op->number > addr_bytes)
Error: CLANG_WARNING: [#def43]
elfutils-0.191/libdwfl/frame_unwind.c:473:4: warning[unix.Malloc]: Potential leak of memory pointed to by 'stack.addrs'
# 471| break;
# 472| default:
# 473|-> __libdwfl_seterrno (DWFL_E_INVALID_DWARF);
# 474| return false;
# 475| }
Error: CPPCHECK_WARNING (CWE-401): [#def44]
elfutils-0.191/libdwfl/frame_unwind.c:511: error[memleak]: Memory leak: unwound
# 509| unwound = malloc (sizeof (*unwound) + sizeof (*unwound->regs) * nregs);
# 510| if (unlikely (unwound == NULL))
# 511|-> return NULL;
# 512| state->unwound = unwound;
# 513| unwound->thread = thread;
Error: CLANG_WARNING: [#def45]
elfutils-0.191/libdwfl/gzip.c:122:3: warning[unix.Malloc]: Attempt to free released memory
# 120| *state->whole = NULL;
# 121| }
# 122|-> free (state->buffer);
# 123| return failure;
# 124| }
Error: CPPCHECK_WARNING (CWE-401): [#def46]
elfutils-0.191/libdwfl/gzip.c:202: error[memleak]: Memory leak: state.input_buffer
# 200| state.input_buffer = malloc (READ_SIZE);
# 201| if (unlikely (state.input_buffer == NULL))
# 202|-> return DWFL_E_NOMEM;
# 203|
# 204| ssize_t n = pread_retry (fd, state.input_buffer, READ_SIZE, start_offset);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def47]
elfutils-0.191/libdwfl/gzip.c: scope_hint: In function ‘__libdw_gunzip’
elfutils-0.191/libdwfl/gzip.c:221:4: warning[-Wanalyzer-null-argument]: use of NULL ‘mapped’ where non-null expected
elfutils-0.191/libdwfl/gzip.c:224:7: note: in expansion of macro ‘NOMAGIC’
elfutils-0.191/libdwfl/gzip.c:224:7: note: in expansion of macro ‘NOMAGIC’
elfutils-0.191/libdwfl/gzip.c:224:7: note: in expansion of macro ‘NOMAGIC’
elfutils-0.191/libdwfl/libdwflP.h:39: included_from: Included from here.
elfutils-0.191/libdwfl/gzip.c:33: included_from: Included from here.
/usr/include/string.h:64:12: note: argument 1 of ‘memcmp’ must be non-null
# 219| #define NOMAGIC(magic) \
# 220| (state.mapped_size <= sizeof magic || \
# 221|-> memcmp (mapped, magic, sizeof magic - 1))
# 222|
# 223| /* First, look at the header. */
Error: CLANG_WARNING: [#def48]
elfutils-0.191/libdwfl/gzip.c:224:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 222|
# 223| /* First, look at the header. */
# 224|-> if (NOMAGIC (MAGIC)
# 225| #ifdef MAGIC2
# 226| && NOMAGIC (MAGIC2)
Error: CLANG_WARNING: [#def49]
elfutils-0.191/libdwfl/link_map.c:404:28: warning[core.NullDereference]: Access to field 'fd' results in a dereference of a null pointer (loaded from variable 'r_debug_info_module')
# 402| release_buffer (&memory_closure, &buffer,
# 403| &buffer_available, result);
# 404|-> r_debug_info_module->fd = -1;
# 405| r_debug_info_module->elf = NULL;
# 406| r_debug_info_module->l_ld = l_ld;
Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
elfutils-0.191/libdwfl/linux-kernel-modules.c: scope_hint: In function ‘try_kernel_name’
elfutils-0.191/libdwfl/linux-kernel-modules.c:104:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘<unknown>’
/usr/include/bits/sigstksz.h:24: included_from: Included from here.
/usr/include/signal.h:328: included_from: Included from here.
/usr/include/sys/param.h:28: included_from: Included from here.
elfutils-0.191/lib/system.h:47: included_from: Included from here.
elfutils-0.191/libdwfl/linux-kernel-modules.c:40: included_from: Included from here.
# 102| : TEMP_FAILURE_RETRY (open (*fname, O_RDONLY)));
# 103|
# 104|-> if (fd < 0)
# 105| {
# 106| Dwfl_Module fakemod = { .dwfl = dwfl };
Error: CPPCHECK_WARNING (CWE-401): [#def51]
elfutils-0.191/libdwfl/linux-kernel-modules.c:827: error[memleak]: Memory leak: alternate_name
# 825| {
# 826| free (modulesdir[0]);
# 827|-> return ENOMEM;
# 828| }
# 829| if (!subst_name ('-', '_', module_name, alternate_name, namelen) &&
Error: CLANG_WARNING: [#def52]
elfutils-0.191/libdwfl/relocate.c:369:12: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
# 367| return error;
# 368|
# 369|-> if (shndx == SHN_UNDEF || shndx == SHN_COMMON)
# 370| {
# 371| /* Maybe we can figure it out anyway. */
Error: GCC_ANALYZER_WARNING (CWE-457): [#def53]
elfutils-0.191/libdwfl/relocate.c: scope_hint: In function ‘relocate’
elfutils-0.191/libdwfl/relocate.c:369:32: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘shndx’
elfutils-0.191/config.h:218: included_from: Included from here.
elfutils-0.191/libdwfl/relocate.c:30: included_from: Included from here.
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/libelf/libelf.h:36: included_from: Included from here.
elfutils-0.191/libelf/gelf.h:32: included_from: Included from here.
elfutils-0.191/libelf/libelfP.h:35: included_from: Included from here.
elfutils-0.191/libdwfl/relocate.c:35: included_from: Included from here.
elfutils-0.191/libelf/elf.h:679:43: note: in definition of macro ‘ELF64_R_SYM’
elfutils-0.191/libdwfl/relocate.c:639:28: note: in expansion of macro ‘GELF_R_SYM’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/libdwfl/relocate.c:168:28: note: in expansion of macro ‘INTUSE’
# 367| return error;
# 368|
# 369|-> if (shndx == SHN_UNDEF || shndx == SHN_COMMON)
# 370| {
# 371| /* Maybe we can figure it out anyway. */
Error: CPPCHECK_WARNING (CWE-401): [#def54]
elfutils-0.191/libdwfl/segment.c:68: error[memleak]: Memory leak: naddr
# 66| GElf_Addr *naddr = realloc (dwfl->lookup_addr, sizeof naddr[0] * n);
# 67| if (unlikely (naddr == NULL))
# 68|-> return true;
# 69| int *nsegndx = realloc (dwfl->lookup_segndx, sizeof nsegndx[0] * n);
# 70| if (unlikely (nsegndx == NULL))
Error: CPPCHECK_WARNING (CWE-401): [#def55]
elfutils-0.191/libdwfl/segment.c:74: error[memleak]: Memory leak: nsegndx
# 72| if (naddr != dwfl->lookup_addr)
# 73| free (naddr);
# 74|-> return true;
# 75| }
# 76| dwfl->lookup_alloc = n;
Error: GCC_ANALYZER_WARNING (CWE-457): [#def56]
elfutils-0.191/libelf/libelf.h:36: included_from: Included from here.
elfutils-0.191/libelf/gelf.h:32: included_from: Included from here.
elfutils-0.191/src/unstrip.c:46: included_from: Included from here.
elfutils-0.191/src/unstrip.c: scope_hint: In function ‘adjust_reloc’
elfutils-0.191/libelf/elf.h:681:44: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
elfutils-0.191/libelf/gelf.h:146:41: note: in expansion of macro ‘ELF64_R_INFO’
elfutils-0.191/src/unstrip.c:443:15: note: in expansion of macro ‘GELF_R_INFO’
elfutils-0.191/src/unstrip.c:32: included_from: Included from here.
elfutils-0.191/src/unstrip.c:2298:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2310:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2196:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1431:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/config.h:218: included_from: Included from here.
elfutils-0.191/src/unstrip.c:28: included_from: Included from here.
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1446:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1450:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1498:3: note: in expansion of macro ‘ELF_CHECK’
/usr/include/bits/types/stack_t.h:23: included_from: Included from here.
/usr/include/signal.h:313: included_from: Included from here.
/usr/include/sys/param.h:28: included_from: Included from here.
elfutils-0.191/lib/system.h:47: included_from: Included from here.
elfutils-0.191/src/unstrip.c:49: included_from: Included from here.
elfutils-0.191/src/unstrip.c:1688:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:392:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:396:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:640:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:417:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:666:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:622:9: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:479:11: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/libelf/elf.h:681:59: note: in definition of macro ‘ELF64_R_INFO’
elfutils-0.191/src/unstrip.c:443:15: note: in expansion of macro ‘GELF_R_INFO’
elfutils-0.191/libelf/gelf.h:146:41: note: in expansion of macro ‘ELF64_R_INFO’
elfutils-0.191/src/unstrip.c:443:15: note: in expansion of macro ‘GELF_R_INFO’
# 679| #define ELF64_R_SYM(i) ((i) >> 32)
# 680| #define ELF64_R_TYPE(i) ((i) & 0xffffffff)
# 681|-> #define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
# 682|
# 683| /* Program segment header. */
Error: CPPCHECK_WARNING (CWE-401): [#def57]
elfutils-0.191/libelf/elf32_updatefile.c:222: error[memleak]: Memory leak: scns
# 220| {
# 221| __libelf_seterrno (ELF_E_NOMEM);
# 222|-> return -1;
# 223| }
# 224| char *const shdr_start = ((char *) elf->map_address + elf->start_offset
Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
elfutils-0.191/libelf/elf64_updatefile.c:30: included_from: Included from here.
elfutils-0.191/libelf/elf32_updatefile.c: scope_hint: In function ‘__elf64_updatemmap’
elfutils-0.191/libelf/elf32_updatefile.c:251:25: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
elfutils-0.191/libelf/elf32_updatefile.c:34: included_from: Included from here.
elfutils-0.191/libelf/elf32_updatefile.c:173:18: note: in expansion of macro ‘elf_typesize’
elfutils-0.191/libelf/elf32_updatefile.c:188:13: note: in expansion of macro ‘fctp’
elfutils-0.191/config.h:218: included_from: Included from here.
elfutils-0.191/libelf/elf32_updatefile.c:31: included_from: Included from here.
elfutils-0.191/libelf/elf32_updatefile.c:214:11: note: in expansion of macro ‘unlikely’
# 249| + elf->maximum_size));
# 250|
# 251|-> void *p = malloc (sizeof (ElfW2(LIBELFBITS,Shdr)));
# 252| if (unlikely (p == NULL))
# 253| {
Error: CPPCHECK_WARNING (CWE-401): [#def59]
elfutils-0.191/libelf/elf32_updatefile.c:618: error[memleak]: Memory leak: tmp_phdr
# 616| {
# 617| __libelf_seterrno (ELF_E_NOMEM);
# 618|-> return 1;
# 619| }
# 620|
Error: CPPCHECK_WARNING (CWE-401): [#def60]
elfutils-0.191/libelf/elf32_updatefile.c:678: error[memleak]: Memory leak: shdr_data_mem
# 676| {
# 677| __libelf_seterrno (ELF_E_NOMEM);
# 678|-> return -1;
# 679| }
# 680| shdr_data = shdr_data_mem;
Error: CPPCHECK_WARNING (CWE-401): [#def61]
elfutils-0.191/libelf/elf32_updatefile.c:693: error[memleak]: Memory leak: scns
# 691| free (shdr_data_mem);
# 692| __libelf_seterrno (ELF_E_NOMEM);
# 693|-> return -1;
# 694| }
# 695| sort_sections (scns, list);
Error: CPPCHECK_WARNING (CWE-401): [#def62]
elfutils-0.191/libelf/elf_compress.c:375: error[memleak]: Memory leak: buf_out
# 373| {
# 374| __libelf_seterrno (ELF_E_NOMEM);
# 375|-> return NULL;
# 376| }
# 377|
Error: CPPCHECK_WARNING (CWE-401): [#def63]
elfutils-0.191/libelf/elf_compress.c:421: error[memleak]: Memory leak: buf_out
# 419| {
# 420| __libelf_seterrno (ELF_E_NOMEM);
# 421|-> return NULL;
# 422| }
# 423|
Error: CLANG_WARNING: [#def64]
elfutils-0.191/libelf/elf_strptr.c:60:22: warning[core.NullDereference]: Array access (from variable 'str') results in a null pointer dereference
# 58| #if HAVE_DECL_MEMRCHR
# 59| // Check end first, which is likely a zero terminator, to prevent function call
# 60|-> return ((to > 0 && str[to - 1] == '\0')
# 61| || (to - from > 0 && memrchr (&str[from], '\0', to - from - 1) != NULL));
# 62| #else
Error: COMPILER_WARNING: [#def65]
elfutils-0.191/src/ar.c: scope_hint: In function ‘main’
elfutils-0.191/src/ar.c:139:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 139 | main (int argc, char *argv[])
# | ^
# 137|
# 138| int
# 139|-> main (int argc, char *argv[])
# 140| {
# 141| /* We use no threads here which can interfere with handling a stream. */
Error: COMPILER_WARNING: [#def66]
elfutils-0.191/src/ar.c: scope_hint: In function ‘do_oper_extract’
elfutils-0.191/src/ar.c:455:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 455 | do_oper_extract (int oper, const char *arfname, char **argv, int argc,
# | ^
# 453|
# 454| static int
# 455|-> do_oper_extract (int oper, const char *arfname, char **argv, int argc,
# 456| long int instance)
# 457| {
Error: CLANG_WARNING: [#def67]
elfutils-0.191/src/ar.c:519:17: warning[core.CallAndMessage]: Passed-by-value struct argument contains uninitialized data (e.g., field: 'data')
# 517| ENTRY entry;
# 518| entry.key = arhdr->ar_name;
# 519|-> ENTRY *res = hsearch (entry, FIND);
# 520| if (res != NULL && (instance < 0 || --instance == 0)
# 521| && !found[(char **) res->data - argv])
Error: CLANG_WARNING: [#def68]
elfutils-0.191/src/ar.c:800:55: warning[core.UndefinedBinaryOperatorResult]: The left operand of '-' is a garbage value
# 798| if ((index_off != SARMAG
# 799| && copy_content (elf, newfd, SARMAG, index_off - SARMAG))
# 800|-> || copy_content (elf, newfd, rest_off, st.st_size - rest_off))
# 801| goto nonew_unlink;
# 802|
Error: COMPILER_WARNING: [#def69]
elfutils-0.191/src/ar.c: scope_hint: In function ‘do_oper_delete’
elfutils-0.191/src/ar.c:910:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 910 | do_oper_delete (const char *arfname, char **argv, int argc,
# | ^
# 908|
# 909| static int
# 910|-> do_oper_delete (const char *arfname, char **argv, int argc,
# 911| long int instance)
# 912| {
Error: CLANG_WARNING: [#def70]
elfutils-0.191/src/ar.c:953:17: warning[core.CallAndMessage]: Passed-by-value struct argument contains uninitialized data (e.g., field: 'data')
# 951| ENTRY entry;
# 952| entry.key = arhdr->ar_name;
# 953|-> ENTRY *res = hsearch (entry, FIND);
# 954| if (res != NULL && (instance < 0 || --instance == 0)
# 955| && !found[(char **) res->data - argv])
Error: COMPILER_WARNING: [#def71]
elfutils-0.191/src/ar.c: scope_hint: In function ‘no0print’
elfutils-0.191/src/ar.c:1083:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 1083 | no0print (bool ofmt, char *buf, int bufsize, long int val)
# | ^
# 1081| Returns false if the given value doesn't fit in the given buffer. */
# 1082| static bool
# 1083|-> no0print (bool ofmt, char *buf, int bufsize, long int val)
# 1084| {
# 1085| char tmpbuf[bufsize + 1];
Error: COMPILER_WARNING: [#def72]
elfutils-0.191/src/ar.c: scope_hint: In function ‘do_oper_insert’
elfutils-0.191/src/ar.c:1096:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 1096 | do_oper_insert (int oper, const char *arfname, char **argv, int argc,
# | ^
# 1094|
# 1095| static int
# 1096|-> do_oper_insert (int oper, const char *arfname, char **argv, int argc,
# 1097| const char *member)
# 1098| {
Error: CLANG_WARNING: [#def73]
elfutils-0.191/src/ar.c:1182:17: warning[core.CallAndMessage]: Passed-by-value struct argument contains uninitialized data (e.g., field: 'data')
# 1180| ENTRY entry;
# 1181| entry.key = arhdr->ar_name;
# 1182|-> ENTRY *res = hsearch (entry, FIND);
# 1183| if (res != NULL && found[(char **) res->data - argv] == NULL)
# 1184| {
Error: GCC_ANALYZER_WARNING (CWE-457): [#def74]
elfutils-0.191/src/ar.c: scope_hint: In function ‘do_oper_insert’
elfutils-0.191/src/ar.c:1277:20: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘st.st_mtim.tv_sec’
elfutils-0.191/src/ar.c:38: included_from: Included from here.
# 1275| else if (update_newer
# 1276| && found[cnt]->old_off != -1l
# 1277|-> && found[cnt]->sec > st.st_mtime)
# 1278| /* Do nothing, the file in the archive is younger. */
# 1279| close (newfd);
Error: CPPCHECK_WARNING (CWE-457): [#def75]
elfutils-0.191/src/arlib.c:174: error[legacyUninitvar]: Uninitialized variable: tmpbuf
# 172|
# 173| /* See comment for ar_date above. */
# 174|-> memcpy (&((struct ar_hdr *) symtab.symsoff)->ar_size, tmpbuf,
# 175| snprintf (tmpbuf, sizeof (tmpbuf), "%-*" PRIu32 "",
# 176| (int) sizeof (((struct ar_hdr *) NULL)->ar_size),
Error: CLANG_WARNING: [#def76]
elfutils-0.191/src/arlib.c:174:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 172|
# 173| /* See comment for ar_date above. */
# 174|-> memcpy (&((struct ar_hdr *) symtab.symsoff)->ar_size, tmpbuf,
# 175| snprintf (tmpbuf, sizeof (tmpbuf), "%-*" PRIu32 "",
# 176| (int) sizeof (((struct ar_hdr *) NULL)->ar_size),
Error: COMPILER_WARNING: [#def77]
elfutils-0.191/src/elfcmp.c: scope_hint: In function ‘main’
elfutils-0.191/src/elfcmp.c:122:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 122 | main (int argc, char *argv[])
# | ^
# 120|
# 121| int
# 122|-> main (int argc, char *argv[])
# 123| {
# 124| /* Set locale. */
Error: CLANG_WARNING: [#def78]
elfutils-0.191/src/elfcompress.c:769:21: warning[core.NullDereference]: Array access (from variable 'snamebuf') results in a null pointer dereference
# 767| if (schtype == ZLIB_GNU)
# 768| {
# 769|-> snamebuf[0] = '.';
# 770| strcpy (&snamebuf[1], &sname[2]);
# 771| newname = snamebuf;
Error: GCC_ANALYZER_WARNING (CWE-476): [#def79]
elfutils-0.191/src/elfcompress.c: scope_hint: In function ‘process_file’
elfutils-0.191/src/elfcompress.c:769:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘snamebuf’
elfutils-0.191/src/elfcompress.c:19: included_from: Included from here.
elfutils-0.191/src/elfcompress.c: scope_hint: In function ‘process_file’
# 767| if (schtype == ZLIB_GNU)
# 768| {
# 769|-> snamebuf[0] = '.';
# 770| strcpy (&snamebuf[1], &sname[2]);
# 771| newname = snamebuf;
Error: CLANG_WARNING: [#def80]
elfutils-0.191/src/elfcompress.c:793:17: warning[core.NullDereference]: Array access (from variable 'snamebuf') results in a null pointer dereference
# 791| }
# 792|
# 793|-> snamebuf[0] = '.';
# 794| snamebuf[1] = 'z';
# 795| strcpy (&snamebuf[2], &sname[1]);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def81]
elfutils-0.191/src/elfcompress.c:793:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘snamebuf’
elfutils-0.191/src/elfcompress.c: scope_hint: In function ‘process_file’
# 791| }
# 792|
# 793|-> snamebuf[0] = '.';
# 794| snamebuf[1] = 'z';
# 795| strcpy (&snamebuf[2], &sname[1]);
Error: CLANG_WARNING: [#def82]
elfutils-0.191/src/elfcompress.c:860:18: warning[core.NullDereference]: Array access (from variable 'snamebuf') results in a null pointer dereference
# 858| if (schtype == ZLIB_GNU)
# 859| {
# 860|-> snamebuf[0] = '.';
# 861| strcpy (&snamebuf[1], &sname[2]);
# 862| newname = snamebuf;
Error: GCC_ANALYZER_WARNING (CWE-476): [#def83]
elfutils-0.191/src/elfcompress.c:860:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘snamebuf’
elfutils-0.191/src/elfcompress.c: scope_hint: In function ‘process_file’
# 858| if (schtype == ZLIB_GNU)
# 859| {
# 860|-> snamebuf[0] = '.';
# 861| strcpy (&snamebuf[1], &sname[2]);
# 862| newname = snamebuf;
Error: COMPILER_WARNING: [#def84]
elfutils-0.191/src/elflint.c: scope_hint: In function ‘process_file’
elfutils-0.191/src/elflint.c:232:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 232 | process_file (int fd, Elf *elf, const char *prefix, const char *suffix,
# | ^
# 230| /* Process one file. */
# 231| static void
# 232|-> process_file (int fd, Elf *elf, const char *prefix, const char *suffix,
# 233| const char *fname, size_t size, bool only_one)
# 234| {
Error: COMPILER_WARNING: [#def85]
elfutils-0.191/src/elflint.c: scope_hint: In function ‘compare_hash_gnu_hash’
elfutils-0.191/src/elflint.c:2415:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 2415 | compare_hash_gnu_hash (Ebl *ebl, GElf_Ehdr *ehdr, size_t hash_idx,
# | ^
# 2413| /* Compare content of both hash tables, it must be identical. */
# 2414| static void
# 2415|-> compare_hash_gnu_hash (Ebl *ebl, GElf_Ehdr *ehdr, size_t hash_idx,
# 2416| size_t gnu_hash_idx)
# 2417| {
Error: COMPILER_WARNING: [#def86]
elfutils-0.191/src/elflint.c: scope_hint: In function ‘check_verdef’
elfutils-0.191/src/elflint.c:3273:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 3273 | check_verdef (Ebl *ebl, GElf_Shdr *shdr, int idx)
# | ^
# 3271|
# 3272| static void
# 3273|-> check_verdef (Ebl *ebl, GElf_Shdr *shdr, int idx)
# 3274| {
# 3275| if (++nverdef == 2)
Error: CPPCHECK_WARNING (CWE-401): [#def87]
elfutils-0.191/src/findtextrel.c:336: error[memleakOnRealloc]: Common realloc mistake: 'segments' nulled but not freed upon failure
# 334| {
# 335| nsegments_max *= 2;
# 336|-> segments
# 337| = realloc (segments, nsegments_max * sizeof (segments[0]));
# 338| if (segments == NULL)
Error: COMPILER_WARNING: [#def88]
elfutils-0.191/src/nm.c: scope_hint: In function ‘handle_ar’
elfutils-0.191/src/nm.c:409:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 409 | handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
# | ^
# 407|
# 408| static int
# 409|-> handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
# 410| const char *suffix)
# 411| {
Error: COMPILER_WARNING: [#def89]
elfutils-0.191/src/nm.c: scope_hint: In function ‘show_symbols_sysv’
elfutils-0.191/src/nm.c:725:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 725 | show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
# | ^
# 723| /* Show symbols in SysV format. */
# 724| static void
# 725|-> show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
# 726| GElf_SymX *syms, size_t nsyms, int longest_name,
# 727| int longest_where)
Error: COMPILER_WARNING: [#def90]
elfutils-0.191/src/nm.c: scope_hint: In function ‘show_symbols’
elfutils-0.191/src/nm.c:1226:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 1226 | show_symbols (int fd, Ebl *ebl, GElf_Ehdr *ehdr,
# | ^
# 1224|
# 1225| static void
# 1226|-> show_symbols (int fd, Ebl *ebl, GElf_Ehdr *ehdr,
# 1227| Elf_Scn *scn, Elf_Scn *xndxscn,
# 1228| GElf_Shdr *shdr, const char *prefix, const char *fname,
Error: COMPILER_WARNING: [#def91]
elfutils-0.191/src/nm.c: scope_hint: In function ‘handle_elf’
elfutils-0.191/src/nm.c:1528:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 1528 | handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
# | ^
# 1526|
# 1527| static int
# 1528|-> handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
# 1529| const char *suffix)
# 1530| {
Error: COMPILER_WARNING: [#def92]
elfutils-0.191/src/objdump.c: scope_hint: In function ‘handle_ar’
elfutils-0.191/src/objdump.c:286:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 286 | handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
# | ^
# 284|
# 285| static int
# 286|-> handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
# 287| const char *suffix)
# 288| {
Error: CLANG_WARNING: [#def93]
elfutils-0.191/src/objdump.c:739:6: warning[unix.Malloc]: Argument to free() is the address of a global variable, which is not memory allocated by malloc()
# 737|
# 738| if (color_mode)
# 739|-> free (fmt);
# 740| }
# 741| }
Error: COMPILER_WARNING: [#def94]
elfutils-0.191/src/objdump.c: scope_hint: In function ‘handle_elf.isra’
elfutils-0.191/src/objdump.c:750:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 750 | handle_elf (Elf *elf, const char *prefix, const char *fname,
# | ^
# 748|
# 749| static int
# 750|-> handle_elf (Elf *elf, const char *prefix, const char *fname,
# 751| const char *suffix)
# 752| {
Error: COMPILER_WARNING: [#def95]
elfutils-0.191/src/ranlib.c: scope_hint: In function ‘handle_file’
elfutils-0.191/src/ranlib.c:135:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 135 | handle_file (const char *fname)
# | ^
# 133| /* Handle a file given on the command line. */
# 134| static int
# 135|-> handle_file (const char *fname)
# 136| {
# 137| int fd = open (fname, O_RDONLY);
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def96]
elfutils-0.191/src/ranlib.c: scope_hint: In function ‘handle_file’
elfutils-0.191/src/ranlib.c:233:17: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘newfd’
elfutils-0.191/config.h:218: included_from: Included from here.
elfutils-0.191/src/ranlib.c:20: included_from: Included from here.
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/ranlib.c:25: included_from: Included from here.
# 231| unlink (tmpfname);
# 232| if (newfd != -1)
# 233|-> close (newfd);
# 234| goto nonew;
# 235| }
Error: COMPILER_WARNING: [#def97]
elfutils-0.191/src/readelf.c: scope_hint: In function ‘open_input_section’
elfutils-0.191/src/readelf.c:661:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 661 | open_input_section (int fd)
# | ^
# 659| elf_input_section given a file descriptor to an ELF file. */
# 660| static int
# 661|-> open_input_section (int fd)
# 662| {
# 663| size_t shnums;
Error: COMPILER_WARNING: [#def98]
elfutils-0.191/src/readelf.c: scope_hint: In function ‘process_file’
elfutils-0.191/src/readelf.c:913:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 913 | process_file (int fd, const char *fname, bool only_one)
# | ^
# 911| /* Process one input file. */
# 912| static void
# 913|-> process_file (int fd, const char *fname, bool only_one)
# 914| {
# 915| if (print_archive_index)
Error: COMPILER_WARNING: [#def99]
elfutils-0.191/src/readelf.c: scope_hint: In function ‘handle_versym’
elfutils-0.191/src/readelf.c:3287:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 3287 | handle_versym (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
# | ^
# 3285|
# 3286| static void
# 3287|-> handle_versym (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
# 3288| {
# 3289| int class = gelf_getclass (ebl->elf);
Error: COMPILER_WARNING: [#def100]
elfutils-0.191/src/readelf.c: scope_hint: In function ‘print_debug_frame_section’
elfutils-0.191/src/readelf.c:7154:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 7154 | print_debug_frame_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
# | ^
# 7152|
# 7153| static void
# 7154|-> print_debug_frame_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
# 7155| Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
# 7156| {
Error: COMPILER_WARNING: [#def101]
elfutils-0.191/src/readelf.c: scope_hint: In function ‘print_debug_macinfo_section’
elfutils-0.191/src/readelf.c:10419:1: warning[-Wstack-usage=]: stack usage might be unbounded
#10419 | print_debug_macinfo_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
# | ^
#10417|
#10418| static void
#10419|-> print_debug_macinfo_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
#10420| Ebl *ebl,
#10421| GElf_Ehdr *ehdr __attribute__ ((unused)),
Error: COMPILER_WARNING: [#def102]
elfutils-0.191/src/readelf.c: scope_hint: In function ‘print_debug_macro_section’
elfutils-0.191/src/readelf.c:10581:1: warning[-Wstack-usage=]: stack usage might be unbounded
#10581 | print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
# | ^
#10579|
#10580| static void
#10581|-> print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
#10582| Ebl *ebl,
#10583| GElf_Ehdr *ehdr __attribute__ ((unused)),
Error: COMPILER_WARNING: [#def103]
elfutils-0.191/src/readelf.c: scope_hint: In function ‘handle_core_item’
elfutils-0.191/src/readelf.c:12262:1: warning[-Wstack-usage=]: stack usage might be unbounded
#12262 | handle_core_item (Elf *core, const Ebl_Core_Item *item, const void *desc,
# | ^
#12260|
#12261| static unsigned int
#12262|-> handle_core_item (Elf *core, const Ebl_Core_Item *item, const void *desc,
#12263| unsigned int colno, size_t *repeated_size)
#12264| {
Error: COMPILER_WARNING: [#def104]
elfutils-0.191/src/readelf.c: scope_hint: In function ‘handle_core_note’
elfutils-0.191/src/readelf.c:13086:1: warning[-Wstack-usage=]: stack usage might be unbounded
#13086 | handle_core_note (Ebl *ebl, const GElf_Nhdr *nhdr,
# | ^
#13084|
#13085| static void
#13086|-> handle_core_note (Ebl *ebl, const GElf_Nhdr *nhdr,
#13087| const char *name, const void *desc)
#13088| {
Error: COMPILER_WARNING: [#def105]
elfutils-0.191/src/size.c: scope_hint: In function ‘handle_ar’
elfutils-0.191/src/size.c:340:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 340 | handle_ar (int fd, Elf *elf, const char *prefix, const char *fname)
# | ^
# 338|
# 339| static int
# 340|-> handle_ar (int fd, Elf *elf, const char *prefix, const char *fname)
# 341| {
# 342| size_t prefix_len = prefix == NULL ? 0 : strlen (prefix);
Error: COMPILER_WARNING: [#def106]
elfutils-0.191/src/size.c: scope_hint: In function ‘handle_elf’
elfutils-0.191/src/size.c:634:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 634 | handle_elf (Elf *elf, const char *prefix, const char *fname)
# | ^
# 632|
# 633| static void
# 634|-> handle_elf (Elf *elf, const char *prefix, const char *fname)
# 635| {
# 636| size_t prefix_len = prefix == NULL ? 0 : strlen (prefix);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def107]
elfutils-0.191/src/stack.c: scope_hint: In function ‘main’
elfutils-0.191/src/stack.c:732:46: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
elfutils-0.191/src/stack.c:28: included_from: Included from here.
elfutils-0.191/libdwfl/libdwfl.h:736:7: note: argument 1 of ‘dwfl_pid’ must be non-null
# 730| else
# 731| {
# 732|-> printf ("PID %lld - %s\n", (long long) dwfl_pid (dwfl),
# 733| pid != 0 ? "process" : "core");
# 734| switch (dwfl_getthreads (dwfl, thread_callback, &frames))
Error: COMPILER_WARNING: [#def108]
elfutils-0.191/src/strip.c: scope_hint: In function ‘handle_elf.constprop’
elfutils-0.191/src/strip.c:981:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 981 | handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
# | ^
# 979|
# 980| static int
# 981|-> handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
# 982| mode_t mode, struct timespec tvp[2])
# 983| {
Error: GCC_ANALYZER_WARNING (CWE-457): [#def109]
elfutils-0.191/src/unstrip.c: scope_hint: In function ‘adjust_relocs’
elfutils-0.191/src/unstrip.c:493:35: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
elfutils-0.191/src/unstrip.c:2298:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2310:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2196:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1431:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1446:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1450:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1498:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1688:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:392:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:396:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:640:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:417:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:666:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:622:9: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:490:9: note: in expansion of macro ‘ELF_CHECK’
# 491| if (newshdr->sh_info != STN_UNDEF)
# 492| {
# 493|-> newshdr->sh_info = map[newshdr->sh_info - 1];
# 494| update_shdr (outscn, newshdr);
# 495| }
Error: GCC_ANALYZER_WARNING (CWE-457): [#def110]
elfutils-0.191/src/unstrip.c:530:34: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:2298:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2310:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2196:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1431:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1446:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1450:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1498:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1688:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:392:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:396:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:640:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:417:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:666:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:622:9: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
# 528| for (size_t i = 0; i < nbucket; ++i) \
# 529| if (old_bucket[i] != STN_UNDEF) \
# 530|-> new_bucket[i] = map[old_bucket[i] - 1]; \
# 531| \
# 532| for (size_t i = 1; i < nchain; ++i) \
Error: GCC_ANALYZER_WARNING (CWE-457): [#def111]
elfutils-0.191/src/unstrip.c:534:28: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:2298:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2310:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2196:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1431:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1446:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1450:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1498:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1688:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:392:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:396:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:640:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:417:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:666:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:622:9: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
elfutils-0.191/src/unstrip.c:544:13: note: in expansion of macro ‘CONVERT_HASH’
# 532| for (size_t i = 1; i < nchain; ++i) \
# 533| if (old_chain[i] != STN_UNDEF) \
# 534|-> new_chain[map[i - 1]] = map[old_chain[i] - 1]; \
# 535| \
# 536| record_new_data (new_hash); \
Error: GCC_ANALYZER_WARNING (CWE-457): [#def112]
elfutils-0.191/src/unstrip.c:579:66: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
elfutils-0.191/src/unstrip.c:2298:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2310:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:2196:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1431:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1435:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1439:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1443:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1446:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1450:7: note: in expansion of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:1498:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:1688:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:392:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:396:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:640:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:417:3: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:666:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/lib/eu-config.h:142:46: note: in definition of macro ‘unlikely’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:667:7: note: in expansion of macro ‘ELF_CHECK’
elfutils-0.191/src/unstrip.c:622:9: note: in expansion of macro ‘ELF_CHECK’
# 577| for (size_t i = 1; i < onent; ++i)
# 578| {
# 579|-> GElf_Versym *v = gelf_getversym (data, i, &versym[map[i - 1]]);
# 580| ELF_CHECK (v != NULL, _("cannot get symbol version: %s"));
# 581| }
Error: COMPILER_WARNING: [#def113]
elfutils-0.191/src/unstrip.c: scope_hint: In function ‘add_new_section_symbols.isra’
elfutils-0.191/src/unstrip.c:633:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 633 | add_new_section_symbols (Elf_Scn *old_symscn, size_t old_shnum,
# | ^
# 631| possible, add in section symbols for the added sections. */
# 632| static Elf_Data *
# 633|-> add_new_section_symbols (Elf_Scn *old_symscn, size_t old_shnum,
# 634| Elf *elf, bool rel, Elf_Scn *symscn, size_t shnum)
# 635| {
Error: COMPILER_WARNING: [#def114]
elfutils-0.191/src/unstrip.c: scope_hint: In function ‘copy_elided_sections’
elfutils-0.191/src/unstrip.c:1427:1: warning[-Wstack-usage=]: stack usage might be unbounded
# 1427 | copy_elided_sections (Elf *unstripped, Elf *stripped,
# | ^
# 1425| copying their contents and sh_type from STRIPPED. */
# 1426| static void
# 1427|-> copy_elided_sections (Elf *unstripped, Elf *stripped,
# 1428| const GElf_Ehdr *stripped_ehdr, GElf_Addr bias)
# 1429| {
Error: CPPCHECK_WARNING (CWE-457): [#def115]
elfutils-0.191/src/unstrip.c:1485: warning[uninitvar]: Uninitialized variables: sections.scn, sections.name, sections.sig, sections.outscn, sections.strent, sections.shdr
# 1483|
# 1484| /* Sort the sections, allocated by address and others after. */
# 1485|-> qsort (sections, stripped_shnum - 1, sizeof sections[0],
# 1486| stripped_ehdr->e_type == ET_REL
# 1487| ? compare_sections_rel : compare_sections_nonrel);
Scan Properties
analyzer-version-clang | 18.1.3 |
analyzer-version-cppcheck | 2.13.0 |
analyzer-version-gcc | 14.0.1 |
analyzer-version-gcc-analyzer | 14.0.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-118.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | elfutils-0.191-5.fc41 |
store-results-to | /tmp/tmp_ytn_bh1/elfutils-0.191-5.fc41.tar.xz |
time-created | 2024-04-22 10:55:55 |
time-finished | 2024-04-22 11:01:21 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp_ytn_bh1/elfutils-0.191-5.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp_ytn_bh1/elfutils-0.191-5.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |