Fixed findings

List of Findings

Error: COMPILER_WARNING (CWE-704): [#def1]
pciutils-3.14.0/lib/ecam.c: scope_hint: In function ‘parse_next_addrs’
pciutils-3.14.0/lib/ecam.c:620:10: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  620 |   endptr = strchr(addrs, ',');
#      |          ^
#  618|       }
#  619|   
#  620|->   endptr = strchr(addrs, ',');
#  621|     if (endptr)
#  622|       addr_len = endptr - addrs;

Error: COMPILER_WARNING (CWE-704): [#def2]
pciutils-3.14.0/lib/ecam.c:620:10: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  618|       }
#  619|   
#  620|->   endptr = strchr(addrs, ',');
#  621|     if (endptr)
#  622|       addr_len = endptr - addrs;

Error: CPPCHECK_WARNING (CWE-476): [#def3]
pciutils-3.14.0/lib/sysfs.c:172: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: file
#  170|       {
#  171|         unsigned long long start, end, size, flags;
#  172|->       if (!fgets(buf, sizeof(buf), file))
#  173|   	break;
#  174|         if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
pciutils-3.14.0/lib/sysfs.c:174:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&namebuf, "r")’
pciutils-3.14.0/lib/sysfs.c:337:1: enter_function: entry to ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:341:6: branch_true: following ‘true’ branch...
pciutils-3.14.0/lib/sysfs.c:348:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:383:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:385:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:386:11: call_function: calling ‘sysfs_get_resources’ from ‘sysfs_fill_info’
#  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): [#def5]
pciutils-3.14.0/lib/sysfs.c:174:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&namebuf, "r")’
pciutils-3.14.0/lib/sysfs.c:337:1: enter_function: entry to ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:341:6: branch_true: following ‘true’ branch...
pciutils-3.14.0/lib/sysfs.c:348:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:383:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:385:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:386:11: call_function: calling ‘sysfs_get_resources’ from ‘sysfs_fill_info’
#  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): [#def6]
pciutils-3.14.0/lib/sysfs.c:176:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&namebuf, "r")’
pciutils-3.14.0/lib/sysfs.c:337:1: enter_function: entry to ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:341:6: branch_true: following ‘true’ branch...
pciutils-3.14.0/lib/sysfs.c:348:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:383:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:385:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:386:11: call_function: calling ‘sysfs_get_resources’ from ‘sysfs_fill_info’
#  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): [#def7]
pciutils-3.14.0/lib/sysfs.c:176:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&namebuf, "r")’
pciutils-3.14.0/lib/sysfs.c:337:1: enter_function: entry to ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:341:6: branch_true: following ‘true’ branch...
pciutils-3.14.0/lib/sysfs.c:348:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:383:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:385:11: call_function: inlined call to ‘want_fill’ from ‘sysfs_fill_info’
pciutils-3.14.0/lib/sysfs.c:386:11: call_function: calling ‘sysfs_get_resources’ from ‘sysfs_fill_info’
#  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: COMPILER_WARNING (CWE-704): [#def8]
pciutils-3.14.0/setpci.c: scope_hint: In function ‘parse_options’
pciutils-3.14.0/setpci.c:513:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  513 |             if (e = strchr(opts, *c))
#      |                   ^
#  511|   	    break;
#  512|   	  default:
#  513|-> 	    if (e = strchr(opts, *c))
#  514|   	      {
#  515|   		char *arg;

Error: COMPILER_WARNING (CWE-704): [#def9]
pciutils-3.14.0/setpci.c:513:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  511|   	    break;
#  512|   	  default:
#  513|-> 	    if (e = strchr(opts, *c))
#  514|   	      {
#  515|   		char *arg;

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.97.1
diffbase-analyzer-version-cppcheck2.21.1
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.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-185.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.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namepciutils-3.15.0-2.fc45
diffbase-store-results-to/tmp/tmpqllj0d5v/pciutils-3.15.0-2.fc45.tar.xz
diffbase-time-created2026-08-03 19:01:16
diffbase-time-finished2026-08-03 19:02:34
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpqllj0d5v/pciutils-3.15.0-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpqllj0d5v/pciutils-3.15.0-2.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-185.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namepciutils-3.14.0-3.fc44
store-results-to/tmp/tmplbfi9fzc/pciutils-3.14.0-3.fc44.tar.xz
time-created2026-08-03 18:58:53
time-finished2026-08-03 19:01:00
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmplbfi9fzc/pciutils-3.14.0-3.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmplbfi9fzc/pciutils-3.14.0-3.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9