Task #90756 - debugedit-5.2-3.fc44/scan-results.err
back to task #90756download
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:315:23: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
# 313| # RPM_ARCH to create an unique (dir) name. Warn if they aren't set.
# 314| for n in RPM_BUILD_ROOT RPM_BUILD_DIR RPM_PACKAGE_NAME; do
# 315|-> if eval test -z \"\${$n-}\"; then
# 316| echo >&2 "$n is not set"
# 317| exit 1
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:315:27: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it.
# 313| # RPM_ARCH to create an unique (dir) name. Warn if they aren't set.
# 314| for n in RPM_BUILD_ROOT RPM_BUILD_DIR RPM_PACKAGE_NAME; do
# 315|-> if eval test -z \"\${$n-}\"; then
# 316| echo >&2 "$n is not set"
# 317| exit 1
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:349:1: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
# 347| ELFBINSFILE="$BUILDDIR/elfbins.list"
# 348|
# 349|-> > "$SOURCEFILE"
# 350| > "$LISTFILE"
# 351| > "$LINKSFILE"
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:350:1: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
# 348|
# 349| > "$SOURCEFILE"
# 350|-> > "$LISTFILE"
# 351| > "$LINKSFILE"
# 352| > "$ELFBINSFILE"
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:351:1: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
# 349| > "$SOURCEFILE"
# 350| > "$LISTFILE"
# 351|-> > "$LINKSFILE"
# 352| > "$ELFBINSFILE"
# 353|
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:352:1: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
# 350| > "$LISTFILE"
# 351| > "$LINKSFILE"
# 352|-> > "$ELFBINSFILE"
# 353|
# 354| debugdir="${RPM_BUILD_ROOT}/usr/lib/debug"
Error: SHELLCHECK_WARNING (CWE-571):
/usr/bin/find-debuginfo:378:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 376| local binary="$2"
# 377|
# 378|-> local dynsyms=`mktemp`
# 379| local funcsyms=`mktemp`
# 380| local keep_symbols=`mktemp`
Error: SHELLCHECK_WARNING (CWE-571):
/usr/bin/find-debuginfo:379:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 377|
# 378| local dynsyms=`mktemp`
# 379|-> local funcsyms=`mktemp`
# 380| local keep_symbols=`mktemp`
# 381| local mini_debuginfo=`mktemp`
Error: SHELLCHECK_WARNING (CWE-571):
/usr/bin/find-debuginfo:380:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 378| local dynsyms=`mktemp`
# 379| local funcsyms=`mktemp`
# 380|-> local keep_symbols=`mktemp`
# 381| local mini_debuginfo=`mktemp`
# 382|
Error: SHELLCHECK_WARNING (CWE-571):
/usr/bin/find-debuginfo:381:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 379| local funcsyms=`mktemp`
# 380| local keep_symbols=`mktemp`
# 381|-> local mini_debuginfo=`mktemp`
# 382|
# 383| # In the minisymtab we don't need the .debug_ sections (already removed
Error: SHELLCHECK_WARNING (CWE-571):
/usr/bin/find-debuginfo:389:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 387| # too aggressive. Field $2 is the section name, $3 is the section type
# 388| # and $8 are the section flags.
# 389|-> local remove_sections=`${READELF} -W -S "$debuginfo" \
# 390| | awk '{ if (index($2,".debug_") != 1 \
# 391| && ($3 == "PROGBITS" || $3 == "NOTE" || $3 == "NOBITS") \
Error: SHELLCHECK_WARNING (CWE-398):
/usr/bin/find-debuginfo:484:12: warning[SC2229]: This does not read 'var'. Remove $/${} for that, or use ${var?} to quiet.
# 482| continue
# 483| else
# 484|-> read "$var" < <(echo 1)
# 485| fi
# 486| fi
Error: SHELLCHECK_WARNING (CWE-571):
/usr/bin/find-debuginfo:527:17: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 525| $verbose && echo "considering ${f#$RPM_BUILD_DIR/} ${member} size ${size} at ${offset}"
# 526| local tmpdir="$temp/$inum-archive-member" # super short lived
# 527|-> local member_dn=$(dirname "$member")
# 528| if [ "$member_dn" = "." ]; then
# 529| member_dn="" # empty
Error: SHELLCHECK_WARNING (CWE-571):
/usr/bin/find-debuginfo:533:17: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 531| member_dn="${member_dn}/" # or suffixed with /
# 532| fi
# 533|-> local member_bn=$(basename "$member")
# 534|
# 535| # (re)create a directory to hold the (pathname-inclusive) member
Error: SHELLCHECK_WARNING (CWE-252):
/usr/bin/find-debuginfo:542:12: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
# 540| # distinct instance-number would have to be given to ar ("N ###"),
# 541| # kept on a per-name basis.
# 542|-> (cd "$tmpdir"; dd status=none if="$f" of="$member_dn$member_bn" bs=1 skip="$offset" count="$size")
# 543| if [ $? -ne 0 ]; then
# 544| res=1
Error: SHELLCHECK_WARNING (CWE-252):
/usr/bin/find-debuginfo:564:12: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
# 562|
# 563| # add the file; qP mode, so strict append, no dupe elimination, path preserved
# 564|-> (cd "$tmpdir"; ${AR} qP "$tmpa" "$member_dn$member_bn")
# 565|
# 566| # remove the entire temporary directory, in case another
Error: SHELLCHECK_WARNING (CWE-156):
/usr/bin/find-debuginfo:581:26: warning[SC2046]: Quote this to prevent word splitting.
# 579| rm -f "$tmpa"
# 580|
# 581|-> $verbose && echo found $(tr -dc '\0' < "$SOURCEFILE" | wc -c) source files
# 582|
# 583| # NB: no need to strip or dwz-compress or gdbindex or
Error: SHELLCHECK_WARNING (CWE-156):
/usr/bin/find-debuginfo:632:26: warning[SC2046]: Quote this to prevent word splitting.
# 630| fi
# 631|
# 632|-> $verbose && echo found $(tr -dc '\0' < "$SOURCEFILE" | wc -c) source files
# 633|
# 634| # debugedit makes sure to to get write permission to the file and
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:738:3: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
# 736| local res=0
# 737|
# 738|-> >"$SOURCEFILE"
# 739| >"$ELFBINSFILE"
# 740| # can't use read -n <n>, because it reads bytes one by one, allowing for
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:739:3: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
# 737|
# 738| >"$SOURCEFILE"
# 739|-> >"$ELFBINSFILE"
# 740| # can't use read -n <n>, because it reads bytes one by one, allowing for
# 741| # races
Error: SHELLCHECK_WARNING (CWE-156):
/usr/bin/find-debuginfo:747:13: warning[SC2046]: Quote this to prevent word splitting.
# 745| break
# 746| fi
# 747|-> do_file $(sed -n "$(( 0x$filenum )) p" "$temp/primary")
# 748| res=$?
# 749| if [ $res != 0 ]; then
Error: SHELLCHECK_WARNING (CWE-252):
/usr/bin/find-debuginfo:798:27: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
# 796| if $run_dwz \
# 797| && [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
# 798|-> readarray dwz_files < <(cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug | LC_ALL=C sort)
# 799| if [ ${#dwz_files[@]} -gt 0 ]; then
# 800| $quiet || echo "DWARF-compressing ${#dwz_files[@]} files" 2>&1
Error: SHELLCHECK_WARNING:
/usr/bin/find-debuginfo:811:11: error[SC2157]: Argument to -n is always true due to literal strings.
# 809| dwz_multifile_name="${dwz_multifile_name}${dwz_multifile_suffix}"
# 810| dwz_opts="-h -q -r"
# 811|-> [ -n "-j" ] && dwz_opts="${dwz_opts} -j ${n_jobs}"
# 812| [ ${#dwz_files[@]} -gt 1 ] && [ "$dwz_single_file_mode" = "false" ] \
# 813| && dwz_opts="${dwz_opts} -m .dwz/${dwz_multifile_name}"
Error: SHELLCHECK_WARNING (CWE-88):
/usr/bin/find-debuginfo:820:63: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
# 818| && dwz_opts="${dwz_opts} -L ${dwz_max_die_limit}"
# 819| if type dwz >/dev/null 2>&1; then
# 820|-> ( cd "${RPM_BUILD_ROOT}/usr/lib/debug" && dwz $dwz_opts ${dwz_files[@]} )
# 821| else
# 822| echo >&2 "*** ERROR: DWARF compression requested, but no dwz installed"
Error: SHELLCHECK_WARNING (CWE-252):
/usr/bin/find-debuginfo:832:6: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
# 830| # dwz invalidates .gnu_debuglink CRC32 in the main files.
# 831| cat "$ELFBINSFILE" |
# 832|-> (cd "$RPM_BUILD_ROOT"; \
# 833| tr '\n' '\0' | xargs -0 sepdebugcrcfix usr/lib/debug)
# 834| fi
Error: SHELLCHECK_WARNING (CWE-252):
/usr/bin/find-debuginfo:868:4: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
# 866| # directory (which is why we match against ^ or /).
# 867| LC_ALL=C sort -z -u "$SOURCEFILE" | grep -E -v -z '(^|/)<[a-z _-]+>$' |
# 868|-> (cd "${debug_base_name}"; cpio -pd0mL --quiet "${RPM_BUILD_ROOT}${debug_dest_name}")
# 869| # stupid cpio creates new directories in mode 0700,
# 870| # and non-standard modes may be inherented from original directories, fixup
Error: SHELLCHECK_WARNING (CWE-252):
/usr/bin/find-debuginfo:878:4: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
# 876| ((nout > 0)) ||
# 877| test ! -d "${RPM_BUILD_ROOT}/usr/lib" ||
# 878|-> (cd "${RPM_BUILD_ROOT}/usr/lib"; find debug -type d) |
# 879| sed 's,^,%dir /usr/lib/,' >> "$LISTFILE"
# 880|
Error: SHELLCHECK_WARNING (CWE-252):
/usr/bin/find-debuginfo:881:4: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
# 879| sed 's,^,%dir /usr/lib/,' >> "$LISTFILE"
# 880|
# 881|-> (cd "${RPM_BUILD_ROOT}/usr"
# 882| test ! -d lib/debug || find lib/debug ! -type d
# 883| test ! -d src/debug -o -n "$srcout" || find src/debug -mindepth 1 -maxdepth 1
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:889:3: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
# 887| if [ -n "$srcout" ]; then
# 888| srcout="$BUILDDIR/$srcout"
# 889|-> > "$srcout"
# 890| if [ -d "${RPM_BUILD_ROOT}/usr/src/debug" ]; then
# 891| (cd "${RPM_BUILD_ROOT}/usr"
Error: SHELLCHECK_WARNING (CWE-252):
/usr/bin/find-debuginfo:891:6: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
# 889| > "$srcout"
# 890| if [ -d "${RPM_BUILD_ROOT}/usr/src/debug" ]; then
# 891|-> (cd "${RPM_BUILD_ROOT}/usr"
# 892| find src/debug -mindepth 1 -maxdepth 1
# 893| ) | sed 's,^,/usr/,' >> "$srcout"
Error: SHELLCHECK_WARNING (CWE-569):
/usr/bin/find-debuginfo:944:3: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
# 942| i=0
# 943| while ((i < nout)); do
# 944|-> > ${outs[$i]}
# 945| filtered_list ${outs[$i]} ${lists[$i]}
# 946| pattern_list ${outs[$i]} "${ptns[$i]}"
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:618:13: warning[-Wanalyzer-malloc-leak]: leak of ‘relbuf’
debugedit-5.2/tools/debugedit.c:2651:1: enter_function: entry to ‘edit_info’
debugedit-5.2/tools/debugedit.c:2662:6: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2665:3: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2665:3: call_function: calling ‘setup_relbuf’ from ‘edit_info’
# 616| error (1, errno, "%s: Could not allocate memory", dso->filename);
# 617|
# 618|-> symdata = elf_getdata (dso->scn[dso->shdr[i].sh_link], NULL);
# 619| assert (symdata != NULL && symdata->d_buf != NULL);
# 620| assert (elf_getdata (dso->scn[dso->shdr[i].sh_link], symdata) == NULL);
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:620:3: warning[-Wanalyzer-malloc-leak]: leak of ‘relbuf’
debugedit-5.2/tools/debugedit.c:2651:1: enter_function: entry to ‘edit_info’
debugedit-5.2/tools/debugedit.c:2662:6: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2665:3: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2665:3: call_function: calling ‘setup_relbuf’ from ‘edit_info’
# 618| symdata = elf_getdata (dso->scn[dso->shdr[i].sh_link], NULL);
# 619| assert (symdata != NULL && symdata->d_buf != NULL);
# 620|-> assert (elf_getdata (dso->scn[dso->shdr[i].sh_link], symdata) == NULL);
# 621| assert (symdata->d_off == 0);
# 622| assert (symdata->d_size == dso->shdr[dso->shdr[i].sh_link].sh_size);
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:628:11: warning[-Wanalyzer-malloc-leak]: leak of ‘relend’
debugedit-5.2/tools/debugedit.c:2651:1: enter_function: entry to ‘edit_info’
debugedit-5.2/tools/debugedit.c:2662:6: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2665:3: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2665:3: call_function: calling ‘setup_relbuf’ from ‘edit_info’
# 626| if (dso->shdr[i].sh_type == SHT_REL)
# 627| {
# 628|-> gelf_getrel (data, ndx, &rel);
# 629| rela.r_offset = rel.r_offset;
# 630| rela.r_info = rel.r_info;
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:634:9: warning[-Wanalyzer-malloc-leak]: leak of ‘relend’
debugedit-5.2/tools/debugedit.c:2383:1: enter_function: entry to ‘edit_attributes’
debugedit-5.2/tools/debugedit.c:2394:15: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2396:23: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2408:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2410:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2410:18: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2413:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2414:22: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2426:15: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2426:14: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:2430:15: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2430:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2432:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2492:17: call_function: calling ‘edit_attributes_str_comp_dir’ from ‘edit_attributes’
# 632| }
# 633| else
# 634|-> gelf_getrela (data, ndx, &rela);
# 635| gelf_getsym (symdata, ELF64_R_SYM (rela.r_info), &sym);
# 636| /* Relocations against section symbols are uninteresting in REL. */
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:635:7: warning[-Wanalyzer-malloc-leak]: leak of ‘relend’
debugedit-5.2/tools/debugedit.c:2651:1: enter_function: entry to ‘edit_info’
debugedit-5.2/tools/debugedit.c:2662:6: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2665:3: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2665:3: call_function: calling ‘setup_relbuf’ from ‘edit_info’
# 633| else
# 634| gelf_getrela (data, ndx, &rela);
# 635|-> gelf_getsym (symdata, ELF64_R_SYM (rela.r_info), &sym);
# 636| /* Relocations against section symbols are uninteresting in REL. */
# 637| if (dso->shdr[i].sh_type == SHT_REL && sym.st_value == 0)
Error: GCC_ANALYZER_WARNING (CWE-127):
debugedit-5.2/tools/debugedit.c:1027:33: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
debugedit-5.2/tools/debugedit.c:2030:1: enter_function: entry to ‘read_dwarf5_line_entries’
debugedit-5.2/tools/debugedit.c:2053:26: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2053:40: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2055:6: branch_false: following ‘false’ branch (when ‘collecting_dirs == 0’)...
debugedit-5.2/tools/debugedit.c:2066:3: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2066:29: branch_true: following ‘true’ branch (when ‘ret > entryi’)...
debugedit-5.2/tools/debugedit.c:2066:29: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2071:34: branch_false: following ‘false’ branch (when ‘formati >= format_count’)...
debugedit-5.2/tools/debugedit.c:2183:10: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2183:10: branch_false: following ‘false’ branch (when ‘collecting_dirs == 0’)...
debugedit-5.2/tools/debugedit.c:2186:10: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2186:10: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2188:28: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2189:33: branch_true: following ‘true’ branch (when ‘comp_dir’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2189:49: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2194:14: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2199:15: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2199:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2201:15: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2222:11: call_function: calling ‘canonicalize_path’ from ‘read_dwarf5_line_entries’
# 1025| {
# 1026| char *pre = d - 1; /* includes slash */
# 1027|-> while (droot < pre && IS_DIR_SEPARATOR (*pre))
# 1028| pre--;
# 1029| if (droot <= pre && ! IS_DIR_SEPARATOR (*pre))
Error: GCC_ANALYZER_WARNING (CWE-127):
debugedit-5.2/tools/debugedit.c:1029:33: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
debugedit-5.2/tools/debugedit.c:2030:1: enter_function: entry to ‘read_dwarf5_line_entries’
debugedit-5.2/tools/debugedit.c:2053:26: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2053:40: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2055:6: branch_false: following ‘false’ branch (when ‘collecting_dirs == 0’)...
debugedit-5.2/tools/debugedit.c:2066:3: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2066:29: branch_true: following ‘true’ branch (when ‘ret > entryi’)...
debugedit-5.2/tools/debugedit.c:2066:29: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2071:34: branch_false: following ‘false’ branch (when ‘formati >= format_count’)...
debugedit-5.2/tools/debugedit.c:2183:10: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2183:10: branch_false: following ‘false’ branch (when ‘collecting_dirs == 0’)...
debugedit-5.2/tools/debugedit.c:2186:10: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2186:10: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2188:28: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2189:33: branch_true: following ‘true’ branch (when ‘comp_dir’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2189:49: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2194:14: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2199:15: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2199:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2201:15: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2222:11: call_function: calling ‘canonicalize_path’ from ‘read_dwarf5_line_entries’
# 1027| while (droot < pre && IS_DIR_SEPARATOR (*pre))
# 1028| pre--;
# 1029|-> if (droot <= pre && ! IS_DIR_SEPARATOR (*pre))
# 1030| {
# 1031| while (droot < pre && ! IS_DIR_SEPARATOR (*pre))
Error: GCC_ANALYZER_WARNING (CWE-127):
debugedit-5.2/tools/debugedit.c:1031:39: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
debugedit-5.2/tools/debugedit.c:2030:1: enter_function: entry to ‘read_dwarf5_line_entries’
debugedit-5.2/tools/debugedit.c:2053:26: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2053:40: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2055:6: branch_false: following ‘false’ branch (when ‘collecting_dirs == 0’)...
debugedit-5.2/tools/debugedit.c:2066:3: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2066:29: branch_true: following ‘true’ branch (when ‘ret > entryi’)...
debugedit-5.2/tools/debugedit.c:2066:29: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2071:34: branch_false: following ‘false’ branch (when ‘formati >= format_count’)...
debugedit-5.2/tools/debugedit.c:2183:10: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2183:10: branch_false: following ‘false’ branch (when ‘collecting_dirs == 0’)...
debugedit-5.2/tools/debugedit.c:2186:10: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2186:10: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2188:28: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2189:33: branch_true: following ‘true’ branch (when ‘comp_dir’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2189:49: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2194:14: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2199:15: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2199:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2201:15: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2222:11: call_function: calling ‘canonicalize_path’ from ‘read_dwarf5_line_entries’
# 1029| if (droot <= pre && ! IS_DIR_SEPARATOR (*pre))
# 1030| {
# 1031|-> while (droot < pre && ! IS_DIR_SEPARATOR (*pre))
# 1032| pre--;
# 1033| /* pre now points to the slash */
Error: GCC_ANALYZER_WARNING (CWE-688):
debugedit-5.2/tools/debugedit.c:1087:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘path’ where non-null expected
debugedit-5.2/tools/debugedit.c:2383:1: enter_function: entry to ‘edit_attributes’
debugedit-5.2/tools/debugedit.c:2394:15: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2396:23: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2408:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2410:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2410:18: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2413:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2414:22: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2426:15: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2430:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2432:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2435:30: acquire_memory: this call could return NULL
debugedit-5.2/tools/debugedit.c:2437:22: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2443:42: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2443:42: call_function: calling ‘skip_dir_prefix’ from ‘edit_attributes’
# 1085| {
# 1086| size_t prefix_len = strlen (dir_prefix);
# 1087|-> if (strncmp (path, dir_prefix, prefix_len) == 0)
# 1088| {
# 1089| path += prefix_len;
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:1342:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3467:1: enter_function: entry to ‘fdopen_dso’
debugedit-5.2/tools/debugedit.c:3479:6: branch_false: following ‘false’ branch (when ‘elf’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3485:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3485:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3491:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3491:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3498:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3498:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3507:32: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3509:6: branch_false: following ‘false’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3515:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3515:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3523:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3532:15: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3538:34: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3538:34: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:3539:3: call_function: calling ‘setup_strings’ from ‘fdopen_dso’
# 1340| setup_strings (struct strings *strings)
# 1341| {
# 1342|-> strings->str_tab = strtab_init (false);
# 1343| /* call update_strings to fill this in. */
# 1344| memset (&strings->orig_data, 0, sizeof (strings->orig_data));
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:1342:22: warning[-Wanalyzer-malloc-leak]: leak of ‘dso’
debugedit-5.2/tools/debugedit.c:3467:1: enter_function: entry to ‘fdopen_dso’
debugedit-5.2/tools/debugedit.c:3479:6: branch_false: following ‘false’ branch (when ‘elf’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3485:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3485:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3491:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3491:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3498:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3498:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3507:32: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3507:9: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:3509:6: branch_false: following ‘false’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3515:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3515:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3523:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3532:15: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3538:34: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3539:3: call_function: calling ‘setup_strings’ from ‘fdopen_dso’
# 1340| setup_strings (struct strings *strings)
# 1341| {
# 1342|-> strings->str_tab = strtab_init (false);
# 1343| /* call update_strings to fill this in. */
# 1344| memset (&strings->orig_data, 0, sizeof (strings->orig_data));
Error: GCC_ANALYZER_WARNING (CWE-688):
debugedit-5.2/tools/debugedit.c:2190:29: warning[-Wanalyzer-null-argument]: use of NULL ‘file’ where non-null expected
debugedit-5.2/tools/debugedit.c:2053:26: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2053:40: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2055:6: branch_false: following ‘false’ branch (when ‘collecting_dirs == 0’)...
debugedit-5.2/tools/debugedit.c:2066:3: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2066:29: branch_true: following ‘true’ branch (when ‘ret > entryi’)...
debugedit-5.2/tools/debugedit.c:2066:29: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2071:34: branch_false: following ‘false’ branch (when ‘formati >= format_count’)...
debugedit-5.2/tools/debugedit.c:2183:10: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2183:10: branch_false: following ‘false’ branch (when ‘collecting_dirs == 0’)...
debugedit-5.2/tools/debugedit.c:2186:10: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:2186:10: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2188:28: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2189:33: branch_true: following ‘true’ branch (when ‘comp_dir’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:2189:49: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2190:29: danger: argument 1 (‘file’) NULL where non-null expected
# 2188| char *comp_dir = (*dirs)[0];
# 2189| size_t comp_dir_len = !comp_dir ? 0 : strlen(comp_dir);
# 2190|-> size_t file_len = strlen (file);
# 2191| size_t dir_len = strlen (dir);
# 2192|
Error: GCC_ANALYZER_WARNING (CWE-476):
debugedit-5.2/tools/debugedit.c:2339:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 2337| sizeof (struct line_table),
# 2338| line_table_cmp);
# 2339|-> return table->new_idx;
# 2340| }
# 2341|
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:2413:31: warning[-Wanalyzer-malloc-leak]: leak of ‘comp_dir’
debugedit-5.2/tools/debugedit.c:2383:1: enter_function: entry to ‘edit_attributes’
debugedit-5.2/tools/debugedit.c:2394:15: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2396:23: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2408:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2410:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2410:18: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2413:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2414:22: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2426:15: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2426:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2427:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2430:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2432:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2435:30: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:2437:22: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2443:42: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2443:42: call_function: calling ‘skip_dir_prefix’ from ‘edit_attributes’
debugedit-5.2/tools/debugedit.c:2443:42: return_function: returning to ‘edit_attributes’ from ‘skip_dir_prefix’
debugedit-5.2/tools/debugedit.c:2444:26: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2445:25: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2574:19: call_function: calling ‘skip_form’ from ‘edit_attributes’
debugedit-5.2/tools/debugedit.c:2574:19: return_function: returning to ‘edit_attributes’ from ‘skip_form’
debugedit-5.2/tools/debugedit.c:2394:15: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2396:23: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2408:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2410:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2410:18: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2413:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2413:31: throw: if the called function throws an exception...
debugedit-5.2/tools/debugedit.c:2413:31: danger: ‘comp_dir’ leaks here; was allocated at [(16)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/15)
# 2411| || form == DW_FORM_sec_offset)
# 2412| {
# 2413|-> list_offs = do_read_32_relocated (ptr, debug_sec);
# 2414| if (phase == 0)
# 2415| found_list_offs = 1;
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:2427:31: warning[-Wanalyzer-malloc-leak]: leak of ‘comp_dir’
debugedit-5.2/tools/debugedit.c:2383:1: enter_function: entry to ‘edit_attributes’
debugedit-5.2/tools/debugedit.c:2394:15: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2396:23: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2408:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2410:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2410:18: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2413:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2414:22: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2426:15: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2426:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2427:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2430:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2432:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2435:30: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:2437:22: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2443:42: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2443:42: call_function: calling ‘skip_dir_prefix’ from ‘edit_attributes’
debugedit-5.2/tools/debugedit.c:2443:42: return_function: returning to ‘edit_attributes’ from ‘skip_dir_prefix’
debugedit-5.2/tools/debugedit.c:2444:26: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2445:25: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2574:19: call_function: calling ‘skip_form’ from ‘edit_attributes’
debugedit-5.2/tools/debugedit.c:2574:19: return_function: returning to ‘edit_attributes’ from ‘skip_form’
debugedit-5.2/tools/debugedit.c:2394:15: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2396:23: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2408:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2410:19: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2410:18: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2413:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2413:31: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2414:22: branch_true: following ‘true’ branch (when ‘phase == 0’)...
debugedit-5.2/tools/debugedit.c:2426:15: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2426:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:2427:31: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:2427:31: throw: if the called function throws an exception...
debugedit-5.2/tools/debugedit.c:2427:31: danger: ‘comp_dir’ leaks here; was allocated at [(16)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/15)
# 2425|
# 2426| if (t->attr[i].attr == DW_AT_macros)
# 2427|-> cu->macros_offs = do_read_32_relocated (ptr, debug_sec);
# 2428|
# 2429| /* DW_AT_comp_dir is the current working directory. */
Error: GCC_ANALYZER_WARNING (CWE-775):
debugedit-5.2/tools/debugedit.c:3476:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
debugedit-5.2/tools/debugedit.c:3686:1: enter_function: entry to ‘main’
debugedit-5.2/tools/debugedit.c:3748:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3754:17: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3754:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3760:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3792:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3797:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3797:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3803:20: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3806:6: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3806:28: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3807:10: acquire_resource: opened here
debugedit-5.2/tools/debugedit.c:3810:6: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
debugedit-5.2/tools/debugedit.c:3815:9: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3815:9: call_function: calling ‘fdopen_dso’ from ‘main’
# 3474|
# 3475| if (dest_dir == NULL && (!do_build_id || no_recompute_build_id))
# 3476|-> elf = elf_begin (fd, ELF_C_READ, NULL);
# 3477| else
# 3478| elf = elf_begin (fd, ELF_C_RDWR, NULL);
Error: GCC_ANALYZER_WARNING (CWE-775):
debugedit-5.2/tools/debugedit.c:3478:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
debugedit-5.2/tools/debugedit.c:3686:1: enter_function: entry to ‘main’
debugedit-5.2/tools/debugedit.c:3748:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3754:17: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3754:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3760:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3792:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3797:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3797:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3803:20: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3806:6: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3806:28: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3807:10: acquire_resource: opened here
debugedit-5.2/tools/debugedit.c:3810:6: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
debugedit-5.2/tools/debugedit.c:3815:9: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3815:9: call_function: calling ‘fdopen_dso’ from ‘main’
# 3476| elf = elf_begin (fd, ELF_C_READ, NULL);
# 3477| else
# 3478|-> elf = elf_begin (fd, ELF_C_RDWR, NULL);
# 3479| if (elf == NULL)
# 3480| {
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3515:7: warning[-Wanalyzer-malloc-leak]: leak of ‘dso’
debugedit-5.2/tools/debugedit.c:3479:6: branch_false: following ‘false’ branch (when ‘elf’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3485:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3485:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3491:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3491:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3498:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3498:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3507:32: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3507:9: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:3509:6: branch_false: following ‘false’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3515:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3515:7: throw: if ‘elf_getphdrnum’ throws an exception...
debugedit-5.2/tools/debugedit.c:3515:7: danger: ‘dso’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
# 3513| }
# 3514|
# 3515|-> if (elf_getphdrnum (elf, &phnum) != 0)
# 3516| {
# 3517| error (0, 0, "Couldn't get number of phdrs: %s", elf_errmsg (-1));
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3517:7: warning[-Wanalyzer-malloc-leak]: leak of ‘dso’
debugedit-5.2/tools/debugedit.c:3479:6: branch_false: following ‘false’ branch (when ‘elf’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3485:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3485:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3491:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3491:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3498:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3498:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3507:32: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3507:9: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:3509:6: branch_false: following ‘false’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3515:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3515:6: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3517:7: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3517:7: throw: if ‘elf_errmsg’ throws an exception...
debugedit-5.2/tools/debugedit.c:3517:7: danger: ‘dso’ leaks here; was allocated at [(9)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/8)
# 3515| if (elf_getphdrnum (elf, &phnum) != 0)
# 3516| {
# 3517|-> error (0, 0, "Couldn't get number of phdrs: %s", elf_errmsg (-1));
# 3518| goto error_out;
# 3519| }
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3524:5: warning[-Wanalyzer-malloc-leak]: leak of ‘dso’
debugedit-5.2/tools/debugedit.c:3479:6: branch_false: following ‘false’ branch (when ‘elf’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3485:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3485:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3491:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3491:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3498:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3498:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3507:32: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3507:9: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:3509:6: branch_false: following ‘false’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3515:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3515:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3523:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3523:6: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3524:5: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3524:5: throw: if ‘elf_flagelf’ throws an exception...
debugedit-5.2/tools/debugedit.c:3524:5: danger: ‘dso’ leaks here; was allocated at [(9)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/8)
# 3522| allocated sections in the file. */
# 3523| if (phnum != 0)
# 3524|-> elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
# 3525|
# 3526| memset (dso, 0, sizeof(DSO));
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3534:21: warning[-Wanalyzer-malloc-leak]: leak of ‘dso’
debugedit-5.2/tools/debugedit.c:3479:6: branch_false: following ‘false’ branch (when ‘elf’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3485:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3485:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3491:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3491:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3498:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3498:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3507:32: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3507:9: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:3509:6: branch_false: following ‘false’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3515:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3515:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3523:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3532:15: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3534:21: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3534:21: throw: if ‘elf_getscn’ throws an exception...
debugedit-5.2/tools/debugedit.c:3534:21: danger: ‘dso’ leaks here; was allocated at [(9)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/8)
# 3532| for (i = 0; i < ehdr.e_shnum; ++i)
# 3533| {
# 3534|-> dso->scn[i] = elf_getscn (elf, i);
# 3535| gelf_getshdr (dso->scn[i], dso->shdr + i);
# 3536| }
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3535:7: warning[-Wanalyzer-malloc-leak]: leak of ‘dso’
debugedit-5.2/tools/debugedit.c:3479:6: branch_false: following ‘false’ branch (when ‘elf’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3485:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3485:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3491:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3491:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3498:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3498:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3507:32: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3507:9: acquire_memory: allocated here
debugedit-5.2/tools/debugedit.c:3509:6: branch_false: following ‘false’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3515:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3515:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3523:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3532:15: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3534:21: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3535:7: throw: if ‘gelf_getshdr’ throws an exception...
debugedit-5.2/tools/debugedit.c:3535:7: danger: ‘dso’ leaks here; was allocated at [(9)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/8)
# 3533| {
# 3534| dso->scn[i] = elf_getscn (elf, i);
# 3535|-> gelf_getshdr (dso->scn[i], dso->shdr + i);
# 3536| }
# 3537|
Error: GCC_ANALYZER_WARNING (CWE-457):
debugedit-5.2/tools/debugedit.c:3547:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*dso.filename’
debugedit-5.2/tools/debugedit.c:3479:6: branch_false: following ‘false’ branch (when ‘elf’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3485:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3485:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3491:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3491:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3498:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3498:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3507:32: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3509:6: branch_false: following ‘false’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3515:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3515:6: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3517:7: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3545:6: branch_true: following ‘true’ branch (when ‘dso’ is non-NULL)...
debugedit-5.2/tools/debugedit.c:3547:22: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3547:22: danger: use of uninitialized value ‘*dso.filename’ here
# 3545| if (dso)
# 3546| {
# 3547|-> free ((char *) dso->filename);
# 3548| destroy_strings (&dso->debug_str);
# 3549| destroy_strings (&dso->debug_line_str);
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3619:8: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: danger: ‘<unknown>’ leaks here
# 3617| u.ehdr = dso->ehdr;
# 3618| u.ehdr.e_phoff = u.ehdr.e_shoff = 0;
# 3619|-> if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
# 3620| {
# 3621| bad:
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3619:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:9: throw: if ‘elf64_xlatetom’ throws an exception...
debugedit-5.2/tools/debugedit.c:3619:9: danger: ‘<unknown>’ leaks here
# 3617| u.ehdr = dso->ehdr;
# 3618| u.ehdr.e_phoff = u.ehdr.e_shoff = 0;
# 3619|-> if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
# 3620| {
# 3621| bad:
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3630:12: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3628:17: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3630:13: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3630:12: danger: ‘<unknown>’ leaks here
# 3628| for (i = 0; i < dso->ehdr.e_phnum; ++i)
# 3629| {
# 3630|-> if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL)
# 3631| goto bad;
# 3632| if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3630:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3628:17: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3630:13: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3630:13: throw: if ‘gelf_getphdr’ throws an exception...
debugedit-5.2/tools/debugedit.c:3630:13: danger: ‘<unknown>’ leaks here
# 3628| for (i = 0; i < dso->ehdr.e_phnum; ++i)
# 3629| {
# 3630|-> if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL)
# 3631| goto bad;
# 3632| if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3632:12: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3628:17: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3630:13: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3630:12: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3632:37: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3632:12: danger: ‘<unknown>’ leaks here
# 3630| if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL)
# 3631| goto bad;
# 3632|-> if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
# 3633| goto bad;
# 3634|
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3632:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3628:17: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3630:13: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3630:12: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3632:37: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3632:13: throw: if ‘elf64_xlatetom’ throws an exception...
debugedit-5.2/tools/debugedit.c:3632:13: danger: ‘<unknown>’ leaks here
# 3630| if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL)
# 3631| goto bad;
# 3632|-> if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
# 3633| goto bad;
# 3634|
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3645:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3628:17: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3638:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3640:17: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3641:11: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3641:10: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3643:11: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3645:14: danger: ‘<unknown>’ leaks here
# 3643| u.shdr = dso->shdr[i];
# 3644| u.shdr.sh_offset = 0;
# 3645|-> if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
# 3646| goto bad;
# 3647|
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3645:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3628:17: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3638:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3640:17: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3641:11: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3641:10: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3643:11: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3645:15: throw: if ‘elf64_xlatetom’ throws an exception...
debugedit-5.2/tools/debugedit.c:3645:15: danger: ‘<unknown>’ leaks here
# 3643| u.shdr = dso->shdr[i];
# 3644| u.shdr.sh_offset = 0;
# 3645|-> if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
# 3646| goto bad;
# 3647|
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3652:29: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3628:17: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3638:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3640:17: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3641:11: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3641:10: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3643:11: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3645:14: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3648:48: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3650:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3652:42: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3652:29: throw: if ‘elf_getdata’ throws an exception...
debugedit-5.2/tools/debugedit.c:3652:29: danger: ‘<unknown>’ leaks here
# 3650| if (dso->shdr[i].sh_type != SHT_NOBITS)
# 3651| {
# 3652|-> Elf_Data *d = elf_getdata (dso->scn[i], NULL);
# 3653| if (d == NULL)
# 3654| goto bad;
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/debugedit.c:3653:18: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3628:17: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3638:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3640:17: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3641:11: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3641:10: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3643:11: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3645:14: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3648:48: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3650:14: branch_true: following ‘true’ branch...
debugedit-5.2/tools/debugedit.c:3652:42: branch_true: ...to here
debugedit-5.2/tools/debugedit.c:3653:18: danger: ‘<unknown>’ leaks here
# 3651| {
# 3652| Elf_Data *d = elf_getdata (dso->scn[i], NULL);
# 3653|-> if (d == NULL)
# 3654| goto bad;
# 3655|
Error: GCC_ANALYZER_WARNING (CWE-457):
debugedit-5.2/tools/debugedit.c:3665:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&result_canon’
debugedit-5.2/tools/debugedit.c:3563:1: enter_function: entry to ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3569:6: branch_false: following ‘false’ branch (when ‘build_id_size != 0’)...
debugedit-5.2/tools/debugedit.c:3575:7: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3575:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3576:11: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3589:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3591:3: call_function: inlined call to ‘XXH_INLINE_XXH3_128bits_reset’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3619:8: branch_false: following ‘false’ branch...
debugedit-5.2/tools/debugedit.c:3626:5: branch_false: ...to here
debugedit-5.2/tools/debugedit.c:3661:26: call_function: calling ‘XXH_INLINE_XXH3_128bits_digest’ from ‘handle_build_id’
debugedit-5.2/tools/debugedit.c:3661:26: return_function: returning to ‘handle_build_id’ from ‘XXH_INLINE_XXH3_128bits_digest’
debugedit-5.2/tools/debugedit.c:3665:3: danger: use of uninitialized value ‘&result_canon’ here
# 3663| /* Use canonical-endianness output. */
# 3664| XXH128_canonicalFromHash (&result_canon, result);
# 3665|-> memcpy((unsigned char *)build_id->d_buf + build_id_offset, &result_canon,
# 3666| MIN (build_id_size, sizeof(result_canon)));
# 3667|
Error: GCC_ANALYZER_WARNING (CWE-401):
debugedit-5.2/tools/sepdebugcrcfix.c:178:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
debugedit-5.2/tools/sepdebugcrcfix.c:125:6: branch_false: following ‘false’ branch (when ‘reldir’ is non-NULL)...
debugedit-5.2/tools/sepdebugcrcfix.c:127:22: branch_false: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:131:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/sepdebugcrcfix.c:133:3: branch_false: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:135:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/sepdebugcrcfix.c:140:16: branch_false: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:141:6: branch_false: following ‘false’ branch (when ‘size != -1’)...
debugedit-5.2/tools/sepdebugcrcfix.c:141:6: branch_false: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:149:10: branch_true: following ‘true’ branch (when ‘offset < size’)...
debugedit-5.2/tools/sepdebugcrcfix.c:151:29: branch_true: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:153:10: branch_true: following ‘true’ branch (when ‘buf’ is NULL)...
debugedit-5.2/tools/sepdebugcrcfix.c:155:17: branch_true: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:161:14: branch_false: following ‘false’ branch (when ‘map != 18446744073709551615’)...
debugedit-5.2/tools/sepdebugcrcfix.c:170:10: branch_false: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:170:10: branch_true: following ‘true’ branch (when ‘map’ is NULL)...
debugedit-5.2/tools/sepdebugcrcfix.c:172:14: branch_true: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:172:14: branch_true: following ‘true’ branch (when ‘buf’ is NULL)...
debugedit-5.2/tools/sepdebugcrcfix.c:174:21: branch_true: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:174:21: acquire_memory: allocated here
debugedit-5.2/tools/sepdebugcrcfix.c:175:18: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
debugedit-5.2/tools/sepdebugcrcfix.c:178:25: branch_false: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:178:25: throw: if ‘pread’ throws an exception...
debugedit-5.2/tools/sepdebugcrcfix.c:178:25: danger: ‘buf’ leaks here; was allocated at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
# 176| error (1, 0, _("out of memory"));
# 177| }
# 178|-> ssize_t got = pread (fd, buf, maplen, offset);
# 179| if (got != maplen)
# 180| {
Error: GCC_ANALYZER_WARNING (CWE-775):
debugedit-5.2/tools/sepdebugcrcfix.c:365:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 2)’
debugedit-5.2/tools/sepdebugcrcfix.c:335:6: branch_false: following ‘false’ branch (when ‘argc > 1’)...
debugedit-5.2/tools/sepdebugcrcfix.c:338:3: branch_false: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:339:6: branch_false: following ‘false’ branch...
debugedit-5.2/tools/sepdebugcrcfix.c:339:6: branch_false: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:341:22: branch_true: following ‘true’ branch (when ‘argi < argc’)...
debugedit-5.2/tools/sepdebugcrcfix.c:343:31: branch_true: ...to here
debugedit-5.2/tools/sepdebugcrcfix.c:357:16: acquire_resource: opened here
debugedit-5.2/tools/sepdebugcrcfix.c:365:22: throw: if ‘elf_begin’ throws an exception...
debugedit-5.2/tools/sepdebugcrcfix.c:365:22: danger: ‘open(fname, 2)’ leaks here; was opened at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 363| else
# 364| {
# 365|-> Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
# 366| if (elf == NULL)
# 367| {