Task #118709 - fixed.err

back to task #118709
download
Error: GCC_ANALYZER_WARNING (CWE-476):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c: scope_hint: In function ‘pe_fixup_stdcalls’
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c:1075:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1075 |           at = strchr (name + 1, '@');
#      |              ^
# 1073|   
# 1074|   	if (lead_at)
# 1075|-> 	  at = strchr (name + 1, '@');
# 1076|   	else
# 1077|   	  at = strchr (name, '@');

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c:1075:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1073|   
# 1074|   	if (lead_at)
# 1075|-> 	  at = strchr (name + 1, '@');
# 1076|   	else
# 1077|   	  at = strchr (name, '@');

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c:1077:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1077 |           at = strchr (name, '@');
#      |              ^
# 1075|   	  at = strchr (name + 1, '@');
# 1076|   	else
# 1077|-> 	  at = strchr (name, '@');
# 1078|   
# 1079|   	if (at || lead_at)

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c:1077:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1075|   	  at = strchr (name + 1, '@');
# 1076|   	else
# 1077|-> 	  at = strchr (name, '@');
# 1078|   
# 1079|   	if (at || lead_at)

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c: scope_hint: In function ‘gldi386pe_after_open’
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c:1692:17: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1692 |             pnt = strrchr (bfd_get_filename (is->the_bfd), '.');
#      |                 ^
# 1690|   	       that already have unique names, it shouldn't make any difference
# 1691|   	       as we only append a suffix on the names.  */
# 1692|-> 	    pnt = strrchr (bfd_get_filename (is->the_bfd), '.');
# 1693|   
# 1694|   	    if (pnt != NULL && (fileext_cmp (pnt + 1, "o") != 0 &&

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c:1692:17: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1690|   	       that already have unique names, it shouldn't make any difference
# 1691|   	       as we only append a suffix on the names.  */
# 1692|-> 	    pnt = strrchr (bfd_get_filename (is->the_bfd), '.');
# 1693|   
# 1694|   	    if (pnt != NULL && (fileext_cmp (pnt + 1, "o") != 0 &&

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c: scope_hint: In function ‘gldi386pe_place_orphan’
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c:2074:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2074 |       && (dollar = strchr (secname, '$')) != NULL)
#      |                  ^
# 2072|     /* Look through the script to see where to place this section.  */
# 2073|     if (!bfd_link_relocatable (&link_info)
# 2074|->       && (dollar = strchr (secname, '$')) != NULL)
# 2075|       {
# 2076|         size_t len = dollar - secname;

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pe.c:2074:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2072|     /* Look through the script to see where to place this section.  */
# 2073|     if (!bfd_link_relocatable (&link_info)
# 2074|->       && (dollar = strchr (secname, '$')) != NULL)
# 2075|       {
# 2076|         size_t len = dollar - secname;

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c: scope_hint: In function ‘pep_fixup_stdcalls’
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c:1019:20: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 1019 |         char* at = strchr (undef->root.string, '@');
#      |                    ^~~~~~
# 1017|       if (undef->type == bfd_link_hash_undefined)
# 1018|         {
# 1019|-> 	char* at = strchr (undef->root.string, '@');
# 1020|   	int lead_at = (*undef->root.string == '@');
# 1021|   	if (lead_at)

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c:1019:20: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 1017|       if (undef->type == bfd_link_hash_undefined)
# 1018|         {
# 1019|-> 	char* at = strchr (undef->root.string, '@');
# 1020|   	int lead_at = (*undef->root.string == '@');
# 1021|   	if (lead_at)

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c:1022:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1022 |           at = strchr (undef->root.string + 1, '@');
#      |              ^
# 1020|   	int lead_at = (*undef->root.string == '@');
# 1021|   	if (lead_at)
# 1022|-> 	  at = strchr (undef->root.string + 1, '@');
# 1023|   	if (at || lead_at)
# 1024|   	  {

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c:1022:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1020|   	int lead_at = (*undef->root.string == '@');
# 1021|   	if (lead_at)
# 1022|-> 	  at = strchr (undef->root.string + 1, '@');
# 1023|   	if (at || lead_at)
# 1024|   	  {

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c: scope_hint: In function ‘gldi386pep_after_open’
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c:1689:17: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1689 |             pnt = strrchr (bfd_get_filename (is->the_bfd), '.');
#      |                 ^
# 1687|   	       that already have unique names, it shouldn't make any difference
# 1688|   	       as we only append a suffix on the names.  */
# 1689|-> 	    pnt = strrchr (bfd_get_filename (is->the_bfd), '.');
# 1690|   
# 1691|   	    if (pnt != NULL && (fileext_cmp (pnt + 1, "o") != 0 &&

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c:1689:17: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1687|   	       that already have unique names, it shouldn't make any difference
# 1688|   	       as we only append a suffix on the names.  */
# 1689|-> 	    pnt = strrchr (bfd_get_filename (is->the_bfd), '.');
# 1690|   
# 1691|   	    if (pnt != NULL && (fileext_cmp (pnt + 1, "o") != 0 &&

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c: scope_hint: In function ‘gldi386pep_place_orphan’
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c:1924:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1924 |       && (dollar = strchr (secname, '$')) != NULL)
#      |                  ^
# 1922|     /* Look through the script to see where to place this section.  */
# 1923|     if (!bfd_link_relocatable (&link_info)
# 1924|->       && (dollar = strchr (secname, '$')) != NULL)
# 1925|       {
# 1926|         size_t len = dollar - secname;

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/build-x86_64-redhat-linux/ld/ei386pep.c:1924:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1922|     /* Look through the script to see where to place this section.  */
# 1923|     if (!bfd_link_relocatable (&link_info)
# 1924|->       && (dollar = strchr (secname, '$')) != NULL)
# 1925|       {
# 1926|         size_t len = dollar - secname;

Error: GCC_ANALYZER_WARNING (CWE-476):
binutils-with-gold-2.46/gas/gen-sframe.c:195:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cur_fre’
binutils-with-gold-2.46/gas/gen-sframe.c:2509:1: enter_function: entry to ‘output_sframe’
binutils-with-gold-2.46/gas/gen-sframe.c:2514:3: branch_false: following ‘false’ branch...
binutils-with-gold-2.46/gas/gen-sframe.c:2516:3: call_function: inlined call to ‘sframe_set_version’ from ‘output_sframe’
binutils-with-gold-2.46/gas/gen-sframe.c:2519:3: call_function: calling ‘create_sframe_all’ from ‘output_sframe’
#  193|   {
#  194|     fre->ra_loc = SFRAME_FRE_ELEM_LOC_STACK;
#  195|->   fre->ra_offset = ra_offset;
#  196|     fre->ra_undefined_p = false;
#  197|     fre->merge_candidate = false;

Error: GCC_ANALYZER_WARNING (CWE-476):
binutils-with-gold-2.46/gas/gen-sframe.c:204:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cur_fre’
binutils-with-gold-2.46/gas/gen-sframe.c:2509:1: enter_function: entry to ‘output_sframe’
binutils-with-gold-2.46/gas/gen-sframe.c:2514:3: branch_false: following ‘false’ branch...
binutils-with-gold-2.46/gas/gen-sframe.c:2516:3: call_function: inlined call to ‘sframe_set_version’ from ‘output_sframe’
binutils-with-gold-2.46/gas/gen-sframe.c:2519:3: call_function: calling ‘create_sframe_all’ from ‘output_sframe’
#  202|   {
#  203|     fre->fp_loc = SFRAME_FRE_ELEM_LOC_STACK;
#  204|->   fre->fp_offset = fp_offset;
#  205|     fre->merge_candidate = false;
#  206|   }

Error: GCC_ANALYZER_WARNING (CWE-476):
binutils-with-gold-2.46/gas/gen-sframe.c:2248:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cur_fre’
binutils-with-gold-2.46/gas/gen-sframe.c:2509:1: enter_function: entry to ‘output_sframe’
binutils-with-gold-2.46/gas/gen-sframe.c:2514:3: branch_false: following ‘false’ branch...
binutils-with-gold-2.46/gas/gen-sframe.c:2516:3: call_function: inlined call to ‘sframe_set_version’ from ‘output_sframe’
binutils-with-gold-2.46/gas/gen-sframe.c:2519:3: call_function: calling ‘create_sframe_all’ from ‘output_sframe’
# 2246|     else if (cfi_insn->u.r == SFRAME_CFA_FP_REG)
# 2247|       {
# 2248|->       cur_fre->fp_loc = SFRAME_FRE_ELEM_LOC_NONE;
# 2249|         cur_fre->fp_offset = 0;
# 2250|         cur_fre->merge_candidate = false;

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/gprof/source.c: scope_hint: In function ‘annotate_source’
binutils-with-gold-2.46/gprof/source.c:126:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  126 |           name_only = strrchr (sf->name, '/');
#      |                     ^
#  124|         if (!sle && !name_only)
#  125|   	{
#  126|-> 	  name_only = strrchr (sf->name, '/');
#  127|   #ifdef HAVE_DOS_BASED_FILE_SYSTEM
#  128|   	  {

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/gprof/source.c:126:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  124|         if (!sle && !name_only)
#  125|   	{
#  126|-> 	  name_only = strrchr (sf->name, '/');
#  127|   #ifdef HAVE_DOS_BASED_FILE_SYSTEM
#  128|   	  {

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/ld/ldelf.c: scope_hint: In function ‘ldelf_search_needed’
binutils-with-gold-2.46/ld/ldelf.c:538:34: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  538 |                       if ((slash = strrchr (replacement, '/')) != NULL)
#      |                                  ^
#  536|   
#  537|   		      replacement = freeme;
#  538|-> 		      if ((slash = strrchr (replacement, '/')) != NULL)
#  539|   			* slash = 0;
#  540|   		    }

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/ld/ldelf.c:538:34: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  536|   
#  537|   		      replacement = freeme;
#  538|-> 		      if ((slash = strrchr (replacement, '/')) != NULL)
#  539|   			* slash = 0;
#  540|   		    }

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/ld/ldelf.c: scope_hint: In function ‘ldelf_parse_ld_so_conf_include’
binutils-with-gold-2.46/ld/ldelf.c:797:17: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  797 |       char *p = strrchr (filename, '/');
#      |                 ^~~~~~~
#  795|     if (pattern[0] != '/')
#  796|       {
#  797|->       char *p = strrchr (filename, '/');
#  798|         size_t patlen = strlen (pattern) + 1;
#  799|   

Error: COMPILER_WARNING (CWE-704):
binutils-with-gold-2.46/ld/ldelf.c:797:17: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  795|     if (pattern[0] != '/')
#  796|       {
#  797|->       char *p = strrchr (filename, '/');
#  798|         size_t patlen = strlen (pattern) + 1;
#  799|   

Error: CPPCHECK_WARNING (CWE-457):
binutils-with-gold-2.46/libctf/ctf-link.c:1738: error[legacyUninitvar]: Uninitialized variable: name
# 1736|     while ((err = ctf_dynhash_next (fp->ctf_dynsyms, &i, &name_, &sym_)) == 0)
# 1737|       {
# 1738|->       const char *name = (const char *) name;
# 1739|         ctf_link_sym_t *symp = (ctf_link_sym_t *) sym_;
# 1740|   

Error: GCC_ANALYZER_WARNING (CWE-401):
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.  */