pciutils-3.12.0-1.fc41
List of Defects
Error: SHELLCHECK_WARNING (CWE-456): [#def1]
/usr/sbin/update-pciids:8:1: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
# 6| DEST=/usr/share/hwdata/pci.ids
# 7| PCI_COMPRESSED_IDS=
# 8|-> GREP=grep
# 9| VERSION=3.12.0
# 10| USER_AGENT=update-pciids/$VERSION
Error: CPPCHECK_WARNING (CWE-664): [#def2]
pciutils-3.12.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: GCC_ANALYZER_WARNING (CWE-465): [#def3]
pciutils-3.12.0/lib/ecam.c: scope_hint: In function ‘validate_addrs’
pciutils-3.12.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: CLANG_WARNING: [#def4]
pciutils-3.12.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: GCC_ANALYZER_WARNING (CWE-688): [#def5]
pciutils-3.12.0/lib/names-parse.c: scope_hint: In function ‘pci_new_load_name_list’
pciutils-3.12.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: GCC_ANALYZER_WARNING (CWE-775): [#def6]
pciutils-3.12.0/lib/proc.c: scope_hint: In function ‘proc_scan’
pciutils-3.12.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): [#def7]
pciutils-3.12.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): [#def8]
pciutils-3.12.0/lib/proc.c: scope_hint: In function ‘proc_setup’
pciutils-3.12.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): [#def9]
pciutils-3.12.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: GCC_ANALYZER_WARNING (CWE-775): [#def10]
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c:173:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&namebuf, "r")’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
# 171| if (!fgets(buf, sizeof(buf), file))
# 172| break;
# 173|-> if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)
# 174| a->error("Syntax error in %s", namebuf);
# 175| if (end > start)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
pciutils-3.12.0/lib/sysfs.c:173:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&namebuf, "r")’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
# 171| if (!fgets(buf, sizeof(buf), file))
# 172| break;
# 173|-> if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)
# 174| a->error("Syntax error in %s", namebuf);
# 175| if (end > start)
Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
pciutils-3.12.0/lib/sysfs.c:175:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&namebuf, "r")’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
# 173| if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)
# 174| a->error("Syntax error in %s", namebuf);
# 175|-> if (end > start)
# 176| size = end - start + 1;
# 177| else
Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
pciutils-3.12.0/lib/sysfs.c:175:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&namebuf, "r")’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
pciutils-3.12.0/lib/sysfs.c: scope_hint: In function ‘sysfs_get_resources’
# 173| if (sscanf(buf, "%llx %llx %llx", &start, &end, &flags) != 3)
# 174| a->error("Syntax error in %s", namebuf);
# 175|-> if (end > start)
# 176| size = end - start + 1;
# 177| else
Error: CPPCHECK_WARNING (CWE-758): [#def14]
pciutils-3.12.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 (CWE-664): [#def15]
pciutils-3.12.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: [#def16]
pciutils-3.12.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-clang | 18.1.3 |
analyzer-version-cppcheck | 2.13.0 |
analyzer-version-gcc | 14.0.1 |
analyzer-version-gcc-analyzer | 14.0.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-144.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | pciutils-3.12.0-1.fc41 |
store-results-to | /tmp/tmpfs8ijpl8/pciutils-3.12.0-1.fc41.tar.xz |
time-created | 2024-04-22 11:22:14 |
time-finished | 2024-04-22 11:23:45 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpfs8ijpl8/pciutils-3.12.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpfs8ijpl8/pciutils-3.12.0-1.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |