Error: GCC_ANALYZER_WARNING (CWE-688): [#def1] util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/mkfs.cramfs.c:305:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(len + 257)’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 303| /* TODO: Reuse the parent's buffer to save memcpy'ing and duplication. */ # 304| path = xmalloc(len + 1 + MAX_INPUT_NAMELEN + 1); # 305|-> memcpy(path, name, len); # 306| endpath = path + len; # 307| *endpath = '/'; Error: GCC_ANALYZER_WARNING (CWE-688): [#def2] util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:36: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/include/all-io.h: scope_hint: In function ‘read_all’ util-linux-2.42.start-build/util-linux-2.42.start/include/all-io.h:67:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.h:18: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:47: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:35: included_from: Included from here. <built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null # 65| int tries = 0; # 66| # 67|-> memset(buf, 0, count); # 68| while (count > 0) { # 69| ret = read(fd, buf, count); Error: GCC_ANALYZER_WARNING (CWE-476): [#def3] util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/blkid.c: scope_hint: In function ‘main’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/blkid.c:889:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)(argc - optind), 8) + (long unsigned int)numdev * 8’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/blkid.c:49: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/blkid.c:18: included_from: Included from here. # 887| continue; # 888| # 889|-> devices[numdev++] = dev; # 890| } # 891| Error: GCC_ANALYZER_WARNING (CWE-476): [#def4] util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/cal.c: scope_hint: In function ‘monthly’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/cal.c:1085:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)*ctl.months_in_row, 208) + (sizetype)i * 208’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/cal.c:79: included_from: Included from here. # 1083| # 1084| for (i = 0; i < ctl->months_in_row - 1; i++) # 1085|-> ms[i].next = &ms[i + 1]; # 1086| # 1087| rows = (ctl->num_months - 1) / ctl->months_in_row; Error: GCC_ANALYZER_WARNING (CWE-688): [#def5] util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c: scope_hint: In function ‘readlink_to_namei’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:115:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc((long unsigned int)(sz + 1))’ where non-null expected util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:39: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:38: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:29: included_from: Included from here. <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 113| if (isrel) { # 114| /* create the absolute path from the relative symlink */ # 115|-> memcpy(nm->abslink, path, nm->relstart); # 116| *(nm->abslink + nm->relstart) = '/'; # 117| nm->relstart++; Error: GCC_ANALYZER_WARNING (CWE-688): [#def6] util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:123:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc((long unsigned int)(sz + 1))’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 121| * - or link without any subdir (foo -> bar) # 122| */ # 123|-> memcpy(nm->abslink, sym, sz); # 124| # 125| nm->abslink[sz] = '\0'; Error: GCC_ANALYZER_WARNING (CWE-688): [#def7] util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c: scope_hint: In function ‘dotdot_stat’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:142:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(len + 4)’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 140| path = xmalloc(len + sizeof(DOTDOTDIR)); # 141| # 142|-> memcpy(path, dirname, len); # 143| memcpy(path + len, DOTDOTDIR, sizeof(DOTDOTDIR)); # 144| Error: GCC_ANALYZER_WARNING (CWE-476): [#def8] util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c: scope_hint: In function ‘open_pidfds’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:64:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_pids, 4) + i * 4’ util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:53:64: note: in definition of macro ‘strtopid_or_err’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:54:55: note: in expansion of macro ‘_’ # 62| # 63| for (size_t i = 0; i < n_pids; i++) { # 64|-> pidfds[i] = pidfd_open(pids[i], 0); # 65| if (pidfds[i] == -1) { # 66| if (allow_exited && errno == ESRCH) { Error: GCC_ANALYZER_WARNING (CWE-688): [#def9] util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/wipefs.c: scope_hint: In function ‘get_desc_for_probe’ util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/wipefs.c:350:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(*len)’ where non-null expected util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/wipefs.c:38: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here. util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:20: included_from: Included from here. <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 348| # 349| wp->magic = xmalloc(*len); # 350|-> memcpy(wp->magic, mag, *len); # 351| wp->len = *len; # 352| Error: GCC_ANALYZER_WARNING (CWE-688): [#def10] util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c: scope_hint: In function ‘get_scols_table’ util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c:551:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(size)’ where non-null expected util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c: scope_hint: In function ‘get_scols_table’ <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 549| size = sizeof(*stat->irq_info) * stat->nr_irq; # 550| result = xmalloc(size); # 551|-> memcpy(result, stat->irq_info, size); # 552| # 553| if (prev) {
| analyzer-version-clippy | 1.85.0 |
| analyzer-version-cppcheck | 2.17 dev |
| analyzer-version-gcc | 15.0.1 |
| analyzer-version-gcc-analyzer | 15.0.1 |
| analyzer-version-shellcheck | 0.10.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.85.0 |
| diffbase-analyzer-version-cppcheck | 2.17 dev |
| diffbase-analyzer-version-gcc | 15.0.1 |
| diffbase-analyzer-version-gcc-analyzer | 15.0.1 |
| diffbase-analyzer-version-shellcheck | 0.10.0 |
| diffbase-analyzer-version-unicontrol | 0.0.2 |
| diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| diffbase-exit-code | 0 |
| diffbase-host | ip-172-16-1-123.us-west-2.compute.internal |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | util-linux-2.42.start-1.20250227100244204432.pr3429.40.g00bd8b9fc |
| diffbase-store-results-to | /tmp/tmpn4jl77hr/util-linux-2.42.start-1.20250227100244204432.pr3429.40.g00bd8b9fc.tar.xz |
| diffbase-time-created | 2025-02-27 10:32:45 |
| diffbase-time-finished | 2025-02-27 10:48:52 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,clippy,gcc,cppcheck' '-o' '/tmp/tmpn4jl77hr/util-linux-2.42.start-1.20250227100244204432.pr3429.40.g00bd8b9fc.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpn4jl77hr/util-linux-2.42.start-1.20250227100244204432.pr3429.40.g00bd8b9fc.src.rpm' |
| diffbase-tool-version | csmock-3.8.0-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-123.us-west-2.compute.internal |
| mock-config | fedora-rawhide-x86_64 |
| project-name | util-linux-2.42.start-1.20250226123015474302.master.39.g467b0c15b |
| store-results-to | /tmp/tmplnc5phrq/util-linux-2.42.start-1.20250226123015474302.master.39.g467b0c15b.tar.xz |
| time-created | 2025-02-27 10:18:19 |
| time-finished | 2025-02-27 10:32:20 |
| title | Fixed findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,clippy,gcc,cppcheck' '-o' '/tmp/tmplnc5phrq/util-linux-2.42.start-1.20250226123015474302.master.39.g467b0c15b.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmplnc5phrq/util-linux-2.42.start-1.20250226123015474302.master.39.g467b0c15b.src.rpm' |
| tool-version | csmock-3.8.0-1.el9 |