Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c: scope_hint: In function ‘ui_create_label’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:2183:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(fdisk_get_nlabels(*cf.cxt) + 1, 32)’
util-linux-2.42.start-build/util-linux-2.42.start/include/debug.h:104:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:274:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start-build/util-linux-2.42.start/include/debug.h:104:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:274:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:270:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:2172:9: note: in expansion of macro ‘DBG’
# 2181|   		    fdisk_label_get_type(lb) == FDISK_DISKLABEL_BSD)
# 2182|   			continue;
# 2183|-> 		cm[i++].name = fdisk_label_get_name(lb);
# 2184|   	}
# 2185|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdformat.c: scope_hint: In function ‘verify_disk’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdformat.c:127:49: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc((long unsigned int)track_size) + (sizetype)count’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdformat.c:20: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdformat.c:28: included_from: Included from here.
#  125|   				}
#  126|   				for (count = 0; count < track_size; count++)
#  127|-> 					if (data[count] != FD_FILL_BYTE) {
#  128|   						if (retries_left) {
#  129|   							format_begin(ctrl);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def3]
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c: scope_hint: In function ‘skip_empty’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:957:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘p0’ 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.
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/disk-utils/fdisk.c:17: included_from: Included from here.
/usr/include/string.h:64:12: note: argument 1 of ‘memcmp’ must be non-null
#  955|   
#  956|   	for (next = i + 16; next < sz; next += 16) {
#  957|-> 		if (memcmp(p0, buf + next, 16) != 0)
#  958|   			break;
#  959|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c: scope_hint: In function ‘dump_buffer’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:976:36: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buf’
#  974|   			printf("%08jx ", (intmax_t)base + i);
#  975|   		}
#  976|-> 		printf(" %02x", buf[i]);
#  977|   		if (l == 7)				/* words separator */
#  978|   			fputs(" ", stdout);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def5]
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/mkfs.cramfs.c:343:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(len + 257)’ where non-null expected
/usr/include/features.h:524: included_from: Included from here.
/usr/include/sys/types.h:25: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/mkfs.cramfs.c:28: included_from: Included from here.
/usr/include/sys/stat.h:327:12: note: argument 1 of ‘lstat’ must be non-null
#  341|   		memcpy(endpath, dirent->d_name, namelen + 1);
#  342|   
#  343|-> 		if (lstat(path, &st) < 0) {
#  344|   			warn(_("stat of %s failed"), endpath);
#  345|   			warn_skip = 1;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def6]
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:145:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(len + 4)’ 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.
/usr/include/features.h:524: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:22: included_from: Included from here.
/usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null
#  143|   	memcpy(path + len, DOTDOTDIR, sizeof(DOTDOTDIR));
#  144|   
#  145|-> 	if (stat(path, st))
#  146|   		err(EXIT_FAILURE, _("stat of %s failed"), path);
#  147|   	free(path);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c: scope_hint: In function ‘parse_pids’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:54:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_strings, 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 ‘_’
#   52|   
#   53|   	for (size_t i = 0; i < n_strings; i++)
#   54|-> 		pids[i] = strtopid_or_err(strings[i], _("failed to parse pid"));
#   55|   
#   56|   	return pids;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def8]
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c: scope_hint: In function ‘sort_result’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c:404:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘result’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c: scope_hint: In function ‘sort_result’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c:20: included_from: Included from here.
/usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null
#  402|   		func = out->sort_cmp_func;
#  403|   
#  404|-> 	qsort(result, nmemb, sizeof(*result),
#  405|   			(int (*)(const void *, const void *)) func);
#  406|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
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:559:41: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cur’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c: scope_hint: In function ‘get_scols_table’
#  557|   			struct irq_info *pre = &prev->irq_info[i];
#  558|   
#  559|-> 			cur->delta = cur->total - pre->total;
#  560|   			stat->delta_irq += cur->delta;
#  561|   		}

Scan Properties

analyzer-version-clippy1.85.0
analyzer-version-cppcheck2.17 dev
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.85.0
diffbase-analyzer-version-cppcheck2.17 dev
diffbase-analyzer-version-gcc15.0.1
diffbase-analyzer-version-gcc-analyzer15.0.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-79.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-nameutil-linux-2.42.start-1.20250226123015474302.master.39.g467b0c15b
diffbase-store-results-to/tmp/tmpk0eypueq/util-linux-2.42.start-1.20250226123015474302.master.39.g467b0c15b.tar.xz
diffbase-time-created2025-02-27 10:12:26
diffbase-time-finished2025-02-27 10:28:31
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,clippy,gcc,cppcheck' '-o' '/tmp/tmpk0eypueq/util-linux-2.42.start-1.20250226123015474302.master.39.g467b0c15b.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpk0eypueq/util-linux-2.42.start-1.20250226123015474302.master.39.g467b0c15b.src.rpm'
diffbase-tool-versioncsmock-3.8.0-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-79.us-west-2.compute.internal
mock-configfedora-rawhide-x86_64
project-nameutil-linux-2.42.start-1.20250227095734028016.pr3429.40.g5e0b818a6
store-results-to/tmp/tmpu9_ltwms/util-linux-2.42.start-1.20250227095734028016.pr3429.40.g5e0b818a6.tar.xz
time-created2025-02-27 10:29:01
time-finished2025-02-27 10:44:10
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,clippy,gcc,cppcheck' '-o' '/tmp/tmpu9_ltwms/util-linux-2.42.start-1.20250227095734028016.pr3429.40.g5e0b818a6.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpu9_ltwms/util-linux-2.42.start-1.20250227095734028016.pr3429.40.g5e0b818a6.src.rpm'
tool-versioncsmock-3.8.0-1.el9