Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
binutils-with-gold-2.46/bfd/elfxx-x86.c:1992:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘htab’
# 1990|       {
# 1991|       case SFRAME_PLT:
# 1992|->       ectx = htab->plt_cfe_ctx;
# 1993|         sec = htab->plt_sframe;
# 1994|         break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
binutils-with-gold-2.46/bfd/elfxx-x86.c:1996:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘htab’
# 1994|         break;
# 1995|       case SFRAME_PLT_SEC:
# 1996|->       ectx = htab->plt_second_cfe_ctx;
# 1997|         sec = htab->plt_second_sframe;
# 1998|         break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
binutils-with-gold-2.46/bfd/elfxx-x86.c:2000:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘htab’
# 1998|         break;
# 1999|       case SFRAME_PLT_GOT:
# 2000|->       ectx = htab->plt_got_cfe_ctx;
# 2001|         sec = htab->plt_got_sframe;
# 2002|         break;

Error: COMPILER_WARNING (CWE-704): [#def4]
binutils-with-gold-2.46/binutils/addr2line.c: scope_hint: In function ‘translate_addresses’
binutils-with-gold-2.46/binutils/addr2line.c:390:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  390 |                   h = strrchr (filename, '/');
#      |                     ^
#  388|                     char *h;
#  389|   
#  390|->                   h = strrchr (filename, '/');
#  391|                     if (h != NULL)
#  392|                       filename = h + 1;

Error: COMPILER_WARNING (CWE-704): [#def5]
binutils-with-gold-2.46/binutils/addr2line.c:390:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  388|                     char *h;
#  389|   
#  390|->                   h = strrchr (filename, '/');
#  391|                     if (h != NULL)
#  392|                       filename = h + 1;

Error: COMPILER_WARNING (CWE-704): [#def6]
binutils-with-gold-2.46/binutils/nm.c: scope_hint: In function ‘print_symname’
binutils-with-gold-2.46/binutils/nm.c:689:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  689 |       char *atver = strchr (name, '@');
#      |                     ^~~~~~
#  687|         && bfd_get_flavour (abfd) == bfd_target_elf_flavour)
#  688|       {
#  689|->       char *atver = strchr (name, '@');
#  690|   
#  691|         if (atver)

Error: COMPILER_WARNING (CWE-704): [#def7]
binutils-with-gold-2.46/binutils/nm.c:689:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  687|         && bfd_get_flavour (abfd) == bfd_target_elf_flavour)
#  688|       {
#  689|->       char *atver = strchr (name, '@');
#  690|   
#  691|         if (atver)

Error: COMPILER_WARNING (CWE-704): [#def8]
binutils-with-gold-2.46/binutils/prdbg.c: scope_hint: In function ‘tg_start_function’
binutils-with-gold-2.46/binutils/prdbg.c:2658:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2658 |       sep = strchr (name, '(');
#      |           ^
# 2656|   	  name = dname;
# 2657|   	}
# 2658|->       sep = strchr (name, '(');
# 2659|         if (sep)
# 2660|   	*sep = 0;

Error: COMPILER_WARNING (CWE-704): [#def9]
binutils-with-gold-2.46/binutils/prdbg.c:2658:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2656|   	  name = dname;
# 2657|   	}
# 2658|->       sep = strchr (name, '(');
# 2659|         if (sep)
# 2660|   	*sep = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def10]
binutils-with-gold-2.46/binutils/readelf.c:6775: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: section
# 6773|       error (_("Out of memory allocating dump request table.\n"));
# 6774|   
# 6775|->   new_request->name = strdup (section);
# 6776|     if (!new_request->name)
# 6777|       error (_("Out of memory allocating dump request table.\n"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
binutils-with-gold-2.46/libsframe/sframe.c:2001:1: warning[-Wanalyzer-malloc-leak]: leak of ‘ectx’
binutils-with-gold-2.46/libsframe/sframe.c:1970:1: enter_function: entry to ‘sframe_encode’
binutils-with-gold-2.46/libsframe/sframe.c:1976:6: branch_false: following ‘false’ branch (when ‘ver == 3’)...
binutils-with-gold-2.46/libsframe/sframe.c:1979:15: branch_false: ...to here
binutils-with-gold-2.46/libsframe/sframe.c:1979:15: acquire_memory: allocated here
binutils-with-gold-2.46/libsframe/sframe.c:1979:6: branch_false: following ‘false’ branch (when ‘ectx’ is non-NULL)...
binutils-with-gold-2.46/libsframe/sframe.c:1982:3: branch_false: ...to here
binutils-with-gold-2.46/libsframe/sframe.c:1993:6: branch_true: following ‘true’ branch...
binutils-with-gold-2.46/libsframe/sframe.c:1994:11: call_function: inlined call to ‘sframe_ret_set_errno’ from ‘sframe_encode’
binutils-with-gold-2.46/libsframe/sframe.c:2001:1: danger: ‘ectx’ leaks here; was allocated at [(4)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/3)
# 1999|   
# 2000|     return ectx;
# 2001|-> }
# 2002|   
# 2003|   /* Free the encoder context ECTXP.  */

Scan Properties

analyzer-version-clippy1.95.0
analyzer-version-cppcheck2.20.0
analyzer-version-gcc16.0.1
analyzer-version-gcc-analyzer16.0.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.95.0
diffbase-analyzer-version-cppcheck2.20.0
diffbase-analyzer-version-gcc16.0.1
diffbase-analyzer-version-gcc-analyzer16.0.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-233.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20260420.180315.gd39a405.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namebinutils-2.46.50-7.fc45
diffbase-store-results-to/tmp/tmp8fl0gkmb/binutils-2.46.50-7.fc45.tar.xz
diffbase-time-created2026-04-28 14:52:51
diffbase-time-finished2026-04-28 15:09:07
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmp8fl0gkmb/binutils-2.46.50-7.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp8fl0gkmb/binutils-2.46.50-7.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-233.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260420.180315.gd39a405.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namebinutils-2.46-1.fc44
store-results-to/tmp/tmppla8sk8v/binutils-2.46-1.fc44.tar.xz
time-created2026-04-28 14:38:45
time-finished2026-04-28 14:51:25
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmppla8sk8v/binutils-2.46-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmppla8sk8v/binutils-2.46-1.fc44.src.rpm'
tool-versioncsmock-3.8.5-1.el9