debugedit-5.0-16.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def2]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:2114:22: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 2112|   	  char *comp_dir = (*dirs)[0];
# 2113|   	  size_t comp_dir_len = !comp_dir ? 0 : strlen(comp_dir);
# 2114|-> 	  size_t file_len = strlen (file);
# 2115|   	  size_t dir_len = strlen (dir);
# 2116|   

Error: CLANG_WARNING: [#def3]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:2115:21: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 2113|   	  size_t comp_dir_len = !comp_dir ? 0 : strlen(comp_dir);
# 2114|   	  size_t file_len = strlen (file);
# 2115|-> 	  size_t dir_len = strlen (dir);
# 2116|   
# 2117|   	  char *s = malloc (comp_dir_len + 1 + file_len + 1 + dir_len + 1);

Error: CPPCHECK_WARNING (CWE-457): [#def4]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:2259: error[uninitvar]: Uninitialized variables: &key.cu, &key.new_idx, &key.size_diff, &key.replace_dirs, &key.replace_files, &key.unit_length, &key.version, &key.header_length, &key.min_instr_len, &key.max_op_per_instr, &key.default_is_stmt, &key.line_base, &key.line_range, &key.opcode_base
# 2257|     struct line_table key;
# 2258|     key.old_idx = idx;
# 2259|->   struct line_table *table = bsearch (&key, lines->table,
# 2260|   				      lines->used,
# 2261|   				      sizeof (struct line_table),

Error: CLANG_WARNING: [#def5]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:2503:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'comp_dir'
# 2501|   	      break;
# 2502|   	    case FORM_ERROR:
# 2503|-> 	      return NULL;
# 2504|   	    case FORM_INDIRECT:
# 2505|   	      continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def6]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c: scope_hint: In function ‘edit_dwarf2’
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:2829:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:31: included_from: Included from here.
/usr/include/string.h:159:12: note: argument 1 of ‘strncmp’ must be non-null
# 2827|   				   dso->shdr[i].sh_name);
# 2828|   
# 2829|-> 	if (strncmp (name, ".debug_", sizeof (".debug_") - 1) == 0)
# 2830|   	  {
# 2831|   	    for (j = 0; debug_sections[j].name; ++j)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c: scope_hint: In function ‘main’
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:3358:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopen_dso(open(file, 2), file)’
# 3356|       }
# 3357|   
# 3358|->   if (ehdr.e_type != ET_DYN && ehdr.e_type != ET_EXEC && ehdr.e_type != ET_REL)
# 3359|       {
# 3360|         error (0, 0, "\"%s\" is not a shared library", name);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def8]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c: scope_hint: In function ‘fdopen_dso’
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:3407:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*dso.filename’
# 3405|     if (dso)
# 3406|       {
# 3407|->       free ((char *) dso->filename);
# 3408|         destroy_strings (&dso->debug_str);
# 3409|         destroy_strings (&dso->debug_line_str);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def9]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c: scope_hint: In function ‘main’
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:3692:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.shdr[i].sh_type’
# 3690|         const char *name;
# 3691|   
# 3692|->       switch (dso->shdr[i].sh_type)
# 3693|   	{
# 3694|   	case SHT_MIPS_DWARF:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def10]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:3707:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
# 3705|   	  name = strptr (dso, dso->ehdr.e_shstrndx, dso->shdr[i].sh_name);
# 3706|   	  /* TODO: Handle stabs */
# 3707|-> 	  if (strcmp (name, ".stab") == 0)
# 3708|   	    {
# 3709|   	      error (0, 0, "Stabs debuginfo not supported: %s", file);

Error: CLANG_WARNING: [#def11]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:3820:17: warning[deadcode.DeadStores]: Value stored to 'sec_offset' during its initialization is never read
# 3818|   	  if ((shdr->sh_flags & SHF_ALLOC) == 0)
# 3819|   	    {
# 3820|-> 	      GElf_Off sec_offset = shdr->sh_offset;
# 3821|   	      GElf_Xword sec_size = shdr->sh_size;
# 3822|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:3873:6: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 3871|       }
# 3872|   
# 3873|->   if (elf_update (dso->elf, ELF_C_NULL) < 0)
# 3874|       {
# 3875|         error (1, 0, "Failed to update file: %s", elf_errmsg (elf_errno ()));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:3881:6: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 3879|       handle_build_id (dso, build_id, build_id_offset, build_id_size);
# 3880|   
# 3881|->   if (elf_update (dso->elf, ELF_C_WRITE) < 0)
# 3882|       {
# 3883|         error (1, 0, "Failed to write file: %s", elf_errmsg (elf_errno()));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
debugedit-5.0-build/debugedit-5.0/tools/debugedit.c:3885:6: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 3883|         error (1, 0, "Failed to write file: %s", elf_errmsg (elf_errno()));
# 3884|       }
# 3885|->   if (elf_end (dso->elf) < 0)
# 3886|       {
# 3887|         error (1, 0, "elf_end failed: %s", elf_errmsg (elf_errno()));

Error: CPPCHECK_WARNING: [#def15]
debugedit-5.0-build/debugedit-5.0/tools/hashtab.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-823): [#def16]
debugedit-5.0-build/debugedit-5.0/tools/hashtab.c:186: error[arrayIndexOutOfBounds]: Array 'prime_tab[30]' accessed at index 30, which is out of bounds.
#  184|   
#  185|     /* If we've run out of primes, abort.  */
#  186|->   if (n > prime_tab[low].prime)
#  187|       {
#  188|         fprintf (stderr, "Cannot find prime bigger than %lu\n", n);

Error: CPPCHECK_WARNING: [#def17]
debugedit-5.0-build/debugedit-5.0/tools/sepdebugcrcfix.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-56.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namedebugedit-5.0-16.fc41
store-results-to/tmp/tmp_cjm74hs/debugedit-5.0-16.fc41.tar.xz
time-created2024-07-03 12:19:05
time-finished2024-07-03 12:20:07
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp_cjm74hs/debugedit-5.0-16.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp_cjm74hs/debugedit-5.0-16.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9