pciutils-3.13.0-1.fc41

List of Defects

Error: CPPCHECK_WARNING (CWE-664): [#def1]
pciutils-3.13.0-build/pciutils-3.13.0/common.c:28: error[va_end_missing]: va_list 'args' was opened but not closed by va_end().
#   26|     fputc('\n', stderr);
#   27|     exit(1);
#   28|-> }
#   29|   
#   30|   void *

Error: CPPCHECK_WARNING: [#def2]
pciutils-3.13.0-build/pciutils-3.13.0/lib/dump.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def3]
pciutils-3.13.0-build/pciutils-3.13.0/lib/ecam.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-465): [#def4]
pciutils-3.13.0-build/pciutils-3.13.0/lib/ecam.c: scope_hint: In function ‘validate_addrs’
pciutils-3.13.0-build/pciutils-3.13.0/lib/ecam.c:653:10: warning[-Wanalyzer-deref-before-check]: check of ‘addrs’ for NULL after already dereferencing it
#  651|       return 1;
#  652|   
#  653|->   while (addrs)
#  654|       if (!parse_next_addrs(addrs, &addrs, NULL, NULL, NULL, NULL, NULL))
#  655|         return 0;

Error: CPPCHECK_WARNING (CWE-758): [#def5]
pciutils-3.13.0-build/pciutils-3.13.0/lib/ecam.c:1041: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1039|           continue;
# 1040|         for (j = 0; j < 32; j++)
# 1041|->         if (segments[i] & (1 << j))
# 1042|             pci_generic_scan_domain(a, 32*i + j);
# 1043|       }

Error: CPPCHECK_WARNING: [#def6]
pciutils-3.13.0-build/pciutils-3.13.0/lib/filter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def7]
pciutils-3.13.0-build/pciutils-3.13.0/lib/filter.c:117:9: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'outp')
#  115|       }
#  116|   
#  117|->   *outp = out;
#  118|     if (maskp)
#  119|       *maskp = mask;

Error: CPPCHECK_WARNING: [#def8]
pciutils-3.13.0-build/pciutils-3.13.0/lib/generic.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def9]
pciutils-3.13.0-build/pciutils-3.13.0/lib/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def10]
pciutils-3.13.0-build/pciutils-3.13.0/lib/mmio-ports.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def11]
pciutils-3.13.0-build/pciutils-3.13.0/lib/names-cache.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def12]
pciutils-3.13.0-build/pciutils-3.13.0/lib/names-hash.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def13]
pciutils-3.13.0-build/pciutils-3.13.0/lib/names-net.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def14]
pciutils-3.13.0-build/pciutils-3.13.0/lib/names-parse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def15]
pciutils-3.13.0-build/pciutils-3.13.0/lib/names-parse.c: scope_hint: In function ‘pci_new_load_name_list’
pciutils-3.13.0-build/pciutils-3.13.0/lib/names-parse.c:286:14: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘temp’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
#  284|                tempsize = strnlen(new_id_path, PATH_MAX) + dp->d_reclen + 1;
#  285|                temp = malloc(tempsize);      /* This malloced memory is freed in the function pci_set_name_list_path() */ 
#  286|->              memset(temp, 0, tempsize);
#  287|                strncpy(temp, new_id_path, (strnlen(new_id_path, PATH_MAX))+1);
#  288|                strncat(temp, dp->d_name, PATH_MAX - strnlen(temp, PATH_MAX));

Error: CPPCHECK_WARNING: [#def16]
pciutils-3.13.0-build/pciutils-3.13.0/lib/proc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
pciutils-3.13.0-build/pciutils-3.13.0/lib/proc.c: scope_hint: In function ‘proc_scan’
pciutils-3.13.0-build/pciutils-3.13.0/lib/proc.c:98:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&buf, "r")’
#   96|   	     &offset);
#   97|   #undef F
#   98|->       if (cnt != 9 && cnt != 10 && cnt != 17)
#   99|   	a->error("proc: parse error (read only %d items)", cnt);
#  100|         d->bus = dfn >> 8U;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
pciutils-3.13.0-build/pciutils-3.13.0/lib/proc.c:98:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&buf, "r")’
#   96|   	     &offset);
#   97|   #undef F
#   98|->       if (cnt != 9 && cnt != 10 && cnt != 17)
#   99|   	a->error("proc: parse error (read only %d items)", cnt);
#  100|         d->bus = dfn >> 8U;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
pciutils-3.13.0-build/pciutils-3.13.0/lib/proc.c: scope_hint: In function ‘proc_setup’
pciutils-3.13.0-build/pciutils-3.13.0/lib/proc.c:152:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*a.fd’
#  150|         a->fd_rw = a->writeable || rw;
#  151|         a->fd = open(buf, a->fd_rw ? O_RDWR : O_RDONLY);
#  152|->       if (a->fd < 0)
#  153|   	{
#  154|   	  e = snprintf(buf, sizeof(buf), "%s/%04x:%02x/%02x.%d",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
pciutils-3.13.0-build/pciutils-3.13.0/lib/proc.c:159:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*a.fd’
#  157|   	  if (e < 0 || e >= (int) sizeof(buf))
#  158|   	    a->error("File name too long");
#  159|-> 	  a->fd = open(buf, a->fd_rw ? O_RDWR : O_RDONLY);
#  160|   	}
#  161|         if (a->fd < 0)

Error: CPPCHECK_WARNING: [#def21]
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c:174:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&namebuf, "r")’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
#  172|         if (!fgets(buf, sizeof(buf), file))
#  173|   	break;
#  174|->       if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)
#  175|   	a->error("Syntax error in %s", namebuf);
#  176|         if (end > start)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c:174:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&namebuf, "r")’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
#  172|         if (!fgets(buf, sizeof(buf), file))
#  173|   	break;
#  174|->       if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)
#  175|   	a->error("Syntax error in %s", namebuf);
#  176|         if (end > start)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def24]
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c:176:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&namebuf, "r")’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
#  174|         if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)
#  175|   	a->error("Syntax error in %s", namebuf);
#  176|->       if (end > start)
#  177|   	size = end - start + 1;
#  178|         else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c:176:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&namebuf, "r")’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.13.0-build/pciutils-3.13.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
#  174|         if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)
#  175|   	a->error("Syntax error in %s", namebuf);
#  176|->       if (end > start)
#  177|   	size = end - start + 1;
#  178|         else

Error: CPPCHECK_WARNING: [#def26]
pciutils-3.13.0-build/pciutils-3.13.0/lmr/margin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def27]
pciutils-3.13.0-build/pciutils-3.13.0/lmr/margin_args.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def28]
pciutils-3.13.0-build/pciutils-3.13.0/lmr/margin_results.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def29]
pciutils-3.13.0-build/pciutils-3.13.0/ls-caps.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def30]
pciutils-3.13.0-build/pciutils-3.13.0/ls-ecaps.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-758): [#def31]
pciutils-3.13.0-build/pciutils-3.13.0/ls-ecaps.c:585: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  583|   
#  584|         printf("\n\t\t\tCtrl:\tEnable%c ID=%d ArbSelect=%s TC/VC=%02x\n",
#  585|-> 	FLAG(rctrl, 1 << 31),
#  586|   	BITS(rctrl, 24, 3),
#  587|   	TABLE(vc_arb_selects, BITS(rctrl, 17, 3), buf),

Error: CPPCHECK_WARNING: [#def32]
pciutils-3.13.0-build/pciutils-3.13.0/ls-map.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def33]
pciutils-3.13.0-build/pciutils-3.13.0/ls-tree.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-758): [#def34]
pciutils-3.13.0-build/pciutils-3.13.0/ls-tree.c:263: error[ctuPointerArith]: Pointer arithmetic overflow; 'line' buffer size is 1024
#  261|   {
#  262|     va_list args;
#  263|->   int space = line + LINE_BUF_SIZE - 1 - p;
#  264|   
#  265|     if (space <= 0)

Error: CPPCHECK_WARNING: [#def35]
pciutils-3.13.0-build/pciutils-3.13.0/lspci.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def36]
pciutils-3.13.0-build/pciutils-3.13.0/pcilmr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def37]
pciutils-3.13.0-build/pciutils-3.13.0/setpci.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-664): [#def38]
pciutils-3.13.0-build/pciutils-3.13.0/setpci.c:460: error[va_end_missing]: va_list 'args' was opened but not closed by va_end().
#  458|     fprintf(stderr, ".\nTry `setpci --help' for more information.\n");
#  459|     exit(1);
#  460|-> }
#  461|   
#  462|   static int

Error: CLANG_WARNING: [#def39]
pciutils-3.13.0-build/pciutils-3.13.0/setpci.c:753:11: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  751|       {
#  752|         unsigned int ll, lim;
#  753|->       e = strchr(value, ',');
#  754|         if (e)
#  755|   	*e++ = 0;

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-83.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namepciutils-3.13.0-1.fc41
store-results-to/tmp/tmptk27kxm1/pciutils-3.13.0-1.fc41.tar.xz
time-created2024-07-03 16:36:37
time-finished2024-07-03 16:38:07
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmptk27kxm1/pciutils-3.13.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmptk27kxm1/pciutils-3.13.0-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9