Newly introduced defects

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
util-linux-2.40.1-build/util-linux-2.40.1/disk-utils/fdformat.c: scope_hint: In function ‘verify_disk’
util-linux-2.40.1-build/util-linux-2.40.1/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.40.1-build/util-linux-2.40.1/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-401): [#def2]
util-linux-2.40.1-build/util-linux-2.40.1/misc-utils/uuidgen.c:22: included_from: Included from here.
util-linux-2.40.1-build/util-linux-2.40.1/include/xalloc.h: scope_hint: In function ‘unhex’
util-linux-2.40.1-build/util-linux-2.40.1/include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((*valuelen >> 1) + 1)’
#   32|   	void *ret = malloc(size);
#   33|   
#   34|-> 	if (!ret && size)
#   35|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   36|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
util-linux-2.40.1-build/util-linux-2.40.1/misc-utils/cal.c: scope_hint: In function ‘monthly’
util-linux-2.40.1-build/util-linux-2.40.1/misc-utils/cal.c:1016:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)*ctl.months_in_row, 208)’
util-linux-2.40.1-build/util-linux-2.40.1/misc-utils/cal.c:79: included_from: Included from here.
# 1014|   
# 1015|   	for (i = 0; i < ctl->months_in_row - 1; i++)
# 1016|-> 		ms[i].next = &ms[i + 1];
# 1017|   
# 1018|   	rows = (ctl->num_months - 1) / ctl->months_in_row;

Error: CPPCHECK_WARNING (CWE-401): [#def4]
util-linux-2.40.1-build/util-linux-2.40.1/misc-utils/getopt.c:449: error[memleak]: Memory leak: ctl.name
#  447|   			break;
#  448|   		case 'T':
#  449|-> 			return TEST_EXIT_CODE;
#  450|   		case 'u':
#  451|   			ctl.quote = 0;

Error: CLANG_WARNING: [#def5]
util-linux-2.40.1-build/util-linux-2.40.1/misc-utils/lslocks.c:244:7: warning[deadcode.DeadStores]: Although the value stored to 'sz' is used in the enclosing expression, the value is never actually read from 'sz'
#  242|   		return NULL;
#  243|   
#  244|-> 	if ((sz = strlen(path)) >= (sizeof(path) - 2))
#  245|   		goto out;
#  246|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
util-linux-2.40.1-build/util-linux-2.40.1/misc-utils/waitpid.c: scope_hint: In function ‘parse_pids’
util-linux-2.40.1-build/util-linux-2.40.1/misc-utils/waitpid.c:54:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_strings, 4) + i * 4’
util-linux-2.40.1-build/util-linux-2.40.1/include/strutils.h:52:64: note: in definition of macro ‘strtopid_or_err’
util-linux-2.40.1-build/util-linux-2.40.1/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: CLANG_WARNING: [#def7]
util-linux-2.40.1-build/util-linux-2.40.1/text-utils/more.c:1065:14: warning[core.UndefinedBinaryOperatorResult]: The left operand of '<' is a garbage value
# 1063|   				}
# 1064|   
# 1065|-> 				if ((*sp < ' ' && *sp != '\n') || *sp == CERASE) {
# 1066|   					--ctl->prompt_len;
# 1067|   					erase_one_column(ctl);

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
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-112.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-nameutil-linux-2.40-0.9.rc1.fc40
diffbase-store-results-to/tmp/tmp9dxs0qyu/util-linux-2.40-0.9.rc1.fc40.tar.xz
diffbase-time-created2024-07-03 18:17:56
diffbase-time-finished2024-07-03 18:25:58
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp9dxs0qyu/util-linux-2.40-0.9.rc1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmp9dxs0qyu/util-linux-2.40-0.9.rc1.fc40.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-112.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nameutil-linux-2.40.1-2.fc41
store-results-to/tmp/tmpw5xc8qnb/util-linux-2.40.1-2.fc41.tar.xz
time-created2024-07-03 18:26:38
time-finished2024-07-03 18:34:24
titleNewly introduced defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpw5xc8qnb/util-linux-2.40.1-2.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpw5xc8qnb/util-linux-2.40.1-2.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9