Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
util-linux-2.42.start/disk-utils/cfdisk.c: scope_hint: In function ‘menu_update_ignore’
util-linux-2.42.start/disk-utils/cfdisk.c:875:28: warning[-Wanalyzer-malloc-leak]: leak of ‘*m.ignore’
util-linux-2.42.start/disk-utils/cfdisk.c:65: included_from: Included from here.
util-linux-2.42.start/include/debug.h:106:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start/disk-utils/cfdisk.c:271:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start/include/debug.h:106:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start/disk-utils/cfdisk.c:271:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start/include/c.h:23: included_from: Included from here.
util-linux-2.42.start/disk-utils/cfdisk.c:55: included_from: Included from here.
util-linux-2.42.start/disk-utils/cfdisk.c:267:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:2170:9: note: in expansion of macro ‘DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:61: included_from: Included from here.
util-linux-2.42.start/disk-utils/cfdisk.c:267:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:903:9: note: in expansion of macro ‘DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:267:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:1182:9: note: in expansion of macro ‘DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:267:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:1182:9: note: in expansion of macro ‘DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:267:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:1182:9: note: in expansion of macro ‘DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:267:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:857:9: note: in expansion of macro ‘DBG’
#  873|   	m->nitems = 0;
#  874|   
#  875|-> 	for (d = m->items; d->name; d++) {
#  876|   		if (m->ignore && strchr(m->ignore, d->key))
#  877|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
util-linux-2.42.start/disk-utils/cfdisk.c: scope_hint: In function ‘menu_set_title’
util-linux-2.42.start/disk-utils/cfdisk.c:952:1: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
util-linux-2.42.start/include/debug.h:106:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start/disk-utils/cfdisk.c:271:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start/include/debug.h:106:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start/disk-utils/cfdisk.c:271:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start/disk-utils/cfdisk.c:267:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:2170:9: note: in expansion of macro ‘DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:267:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start/disk-utils/cfdisk.c:903:9: note: in expansion of macro ‘DBG’
#  950|   	free(m->title);
#  951|   	m->title = str;
#  952|-> }
#  953|   
#  954|   

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

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
util-linux-2.42.start/misc-utils/waitpid.c: scope_hint: In function ‘parse_pids’
util-linux-2.42.start/misc-utils/waitpid.c:53:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_strings, 4) + i * 4’
util-linux-2.42.start/include/strutils.h:55:64: note: in definition of macro ‘strtopid_or_err’
util-linux-2.42.start/misc-utils/waitpid.c:53:55: note: in expansion of macro ‘_’
#   51|   
#   52|   	for (size_t i = 0; i < n_strings; i++)
#   53|-> 		pids[i] = strtopid_or_err(strings[i], _("invalid PID argument"));
#   54|   
#   55|   	return pids;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
util-linux-2.42.start/misc-utils/waitpid.c: scope_hint: In function ‘open_pidfds’
util-linux-2.42.start/misc-utils/waitpid.c:63:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_pids, 4) + i * 4’
util-linux-2.42.start/include/strutils.h:55:64: note: in definition of macro ‘strtopid_or_err’
util-linux-2.42.start/misc-utils/waitpid.c:53:55: note: in expansion of macro ‘_’
#   61|   
#   62|   	for (size_t i = 0; i < n_pids; i++) {
#   63|-> 		pidfds[i] = pidfd_open(pids[i], 0);
#   64|   		if (pidfds[i] == -1) {
#   65|   			if (allow_exited && errno == ESRCH) {

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer15.2.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.18.3
diffbase-analyzer-version-gcc15.2.1
diffbase-analyzer-version-gcc-analyzer15.2.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-178.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.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-nameutil-linux-2.42.start-7.20251225020513184548.pr3873.1048.gdb6466dc6
diffbase-store-results-to/tmp/tmp925do145/util-linux-2.42.start-7.20251225020513184548.pr3873.1048.gdb6466dc6.tar.xz
diffbase-time-created2025-12-25 02:27:49
diffbase-time-finished2025-12-25 02:36:13
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,unicontrol,gcc,shellcheck,clippy' '-o' '/tmp/tmp925do145/util-linux-2.42.start-7.20251225020513184548.pr3873.1048.gdb6466dc6.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp925do145/util-linux-2.42.start-7.20251225020513184548.pr3873.1048.gdb6466dc6.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-178.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameutil-linux-2.42.start-7.20251217121602671579.master.1044.ge4656fa97
store-results-to/tmp/tmpi7oumkmb/util-linux-2.42.start-7.20251217121602671579.master.1044.ge4656fa97.tar.xz
time-created2025-12-25 02:17:52
time-finished2025-12-25 02:27:34
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,unicontrol,gcc,shellcheck,clippy' '-o' '/tmp/tmpi7oumkmb/util-linux-2.42.start-7.20251217121602671579.master.1044.ge4656fa97.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpi7oumkmb/util-linux-2.42.start-7.20251217121602671579.master.1044.ge4656fa97.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9