Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
xfsprogs-6.15.0/db/namei.c:97:18: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xfsprogs-6.15.0/db/namei.c:1118:1: enter_function: entry to ‘link_f’
xfsprogs-6.15.0/db/namei.c:1129:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.15.0/db/namei.c:1130:17: branch_true: ...to here
xfsprogs-6.15.0/db/namei.c:1145:33: call_function: calling ‘path_walk’ from ‘link_f’
#   95|   	int			error;
#   96|   
#   97|-> 	error = -libxfs_trans_alloc_empty(mp, &tp);
#   98|   	if (error)
#   99|   		return error;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
xfsprogs-6.15.0/db/rdump.c:911:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.15.0/db/rdump.c:925:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.15.0/db/rdump.c:947:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/db/rdump.c:954:28: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:962:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/db/rdump.c:969:26: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:973:22: acquire_resource: opened here
xfsprogs-6.15.0/db/rdump.c:974:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/db/rdump.c:980:23: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:980:12: branch_true: following ‘true’ branch...
xfsprogs-6.15.0/db/rdump.c:982:17: branch_true: ...to here
xfsprogs-6.15.0/db/rdump.c:983:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  909|   	}
#  910|   
#  911|-> 	ret = -libxfs_trans_alloc_empty(mp, &tp);
#  912|   	if (ret) {
#  913|   		dbprintf(_("allocating state: %s\n"), strerror(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
xfsprogs-6.15.0/db/rdump.c:911:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.15.0/db/rdump.c:866:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/db/rdump.c:871:16: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:871:16: acquire_memory: allocated here
xfsprogs-6.15.0/db/rdump.c:872:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.15.0/db/rdump.c:876:20: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:911:16: throw: if ‘libxfs_trans_alloc_empty’ throws an exception...
xfsprogs-6.15.0/db/rdump.c:911:16: danger: ‘pbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
#  909|   	}
#  910|   
#  911|-> 	ret = -libxfs_trans_alloc_empty(mp, &tp);
#  912|   	if (ret) {
#  913|   		dbprintf(_("allocating state: %s\n"), strerror(ret));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
xfsprogs-6.15.0/db/rdump.c:913:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.15.0/db/rdump.c:925:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.15.0/db/rdump.c:947:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/db/rdump.c:954:28: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:962:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/db/rdump.c:969:26: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:973:22: acquire_resource: opened here
xfsprogs-6.15.0/db/rdump.c:974:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/db/rdump.c:980:23: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:980:12: branch_true: following ‘true’ branch...
xfsprogs-6.15.0/db/rdump.c:982:17: branch_true: ...to here
xfsprogs-6.15.0/db/rdump.c:983:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  911|   	ret = -libxfs_trans_alloc_empty(mp, &tp);
#  912|   	if (ret) {
#  913|-> 		dbprintf(_("allocating state: %s\n"), strerror(ret));
#  914|   		goto out_pbuf;
#  915|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
xfsprogs-6.15.0/db/rdump.c:913:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.15.0/db/rdump.c:866:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/db/rdump.c:871:16: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:871:16: acquire_memory: allocated here
xfsprogs-6.15.0/db/rdump.c:872:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.15.0/db/rdump.c:876:20: branch_false: ...to here
xfsprogs-6.15.0/db/rdump.c:912:12: branch_true: following ‘true’ branch...
xfsprogs-6.15.0/db/rdump.c:913:17: branch_true: ...to here
xfsprogs-6.15.0/db/rdump.c:913:17: throw: if ‘dbprintf’ throws an exception...
xfsprogs-6.15.0/db/rdump.c:913:17: danger: ‘pbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/2)
#  911|   	ret = -libxfs_trans_alloc_empty(mp, &tp);
#  912|   	if (ret) {
#  913|-> 		dbprintf(_("allocating state: %s\n"), strerror(ret));
#  914|   		goto out_pbuf;
#  915|   	}

Error: CPPCHECK_WARNING (CWE-758): [#def6]
xfsprogs-6.15.0/libfrog/util.c:20: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   18|   
#   19|   	for (rval = 0; rval < NBBY * sizeof(i); rval++) {
#   20|-> 		if ((1 << rval) >= i)
#   21|   			break;
#   22|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
xfsprogs-6.15.0/logprint/log_redo.c:999:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xfsprogs-6.15.0/logprint/log_redo.c:942:1: enter_function: entry to ‘xlog_recover_print_attri’
xfsprogs-6.15.0/logprint/log_redo.c:966:50: acquire_memory: allocated here
xfsprogs-6.15.0/logprint/log_redo.c:966:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xfsprogs-6.15.0/logprint/log_redo.c:971:13: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:971:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/logprint/log_redo.c:974:13: call_function: inlined call to ‘xfs_attr_log_item_op’ from ‘xlog_recover_print_attri’
xfsprogs-6.15.0/logprint/log_redo.c:996:12: branch_true: following ‘true’ branch (when ‘name_len != 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:998:24: branch_true: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:999:17: throw: if ‘print_or_dump’ throws an exception...
xfsprogs-6.15.0/logprint/log_redo.c:999:17: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/1)
#  997|   		region++;
#  998|   		printf(_("ATTRI:  name len:%u\n"), name_len);
#  999|-> 		print_or_dump((char *)item->ri_buf[region].i_addr,
# 1000|   			       name_len);
# 1001|   		name_ptr = item->ri_buf[region].i_addr;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
xfsprogs-6.15.0/logprint/log_redo.c:1007:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xfsprogs-6.15.0/logprint/log_redo.c:942:1: enter_function: entry to ‘xlog_recover_print_attri’
xfsprogs-6.15.0/logprint/log_redo.c:966:50: acquire_memory: allocated here
xfsprogs-6.15.0/logprint/log_redo.c:966:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xfsprogs-6.15.0/logprint/log_redo.c:971:13: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:971:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/logprint/log_redo.c:974:13: call_function: inlined call to ‘xfs_attr_log_item_op’ from ‘xlog_recover_print_attri’
xfsprogs-6.15.0/logprint/log_redo.c:996:12: branch_false: following ‘false’ branch (when ‘name_len == 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1004:12: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1004:12: branch_true: following ‘true’ branch (when ‘new_name_len != 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1005:17: branch_true: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1007:17: throw: if ‘print_or_dump’ throws an exception...
xfsprogs-6.15.0/logprint/log_redo.c:1007:17: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/1)
# 1005|   		region++;
# 1006|   		printf(_("ATTRI:  newname len:%u\n"), new_name_len);
# 1007|-> 		print_or_dump((char *)item->ri_buf[region].i_addr,
# 1008|   			       new_name_len);
# 1009|   		new_name_ptr = item->ri_buf[region].i_addr;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
xfsprogs-6.15.0/logprint/log_redo.c:1017:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xfsprogs-6.15.0/logprint/log_redo.c:942:1: enter_function: entry to ‘xlog_recover_print_attri’
xfsprogs-6.15.0/logprint/log_redo.c:966:50: acquire_memory: allocated here
xfsprogs-6.15.0/logprint/log_redo.c:966:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xfsprogs-6.15.0/logprint/log_redo.c:971:13: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:971:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/logprint/log_redo.c:974:13: call_function: inlined call to ‘xfs_attr_log_item_op’ from ‘xlog_recover_print_attri’
xfsprogs-6.15.0/logprint/log_redo.c:996:12: branch_false: following ‘false’ branch (when ‘name_len == 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1004:12: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1004:12: branch_false: following ‘false’ branch (when ‘new_name_len == 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1012:12: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1012:12: branch_true: following ‘true’ branch (when ‘value_len != 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1013:31: branch_true: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1017:17: throw: if ‘print_or_dump’ throws an exception...
xfsprogs-6.15.0/logprint/log_redo.c:1017:17: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/1)
# 1015|   		region++;
# 1016|   		printf(_("ATTRI:  value len:%u\n"), value_len);
# 1017|-> 		print_or_dump((char *)item->ri_buf[region].i_addr, len);
# 1018|   		value_ptr = item->ri_buf[region].i_addr;
# 1019|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
xfsprogs-6.15.0/logprint/log_redo.c:1026:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xfsprogs-6.15.0/logprint/log_redo.c:942:1: enter_function: entry to ‘xlog_recover_print_attri’
xfsprogs-6.15.0/logprint/log_redo.c:966:50: acquire_memory: allocated here
xfsprogs-6.15.0/logprint/log_redo.c:966:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xfsprogs-6.15.0/logprint/log_redo.c:971:13: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:971:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/logprint/log_redo.c:974:13: call_function: inlined call to ‘xfs_attr_log_item_op’ from ‘xlog_recover_print_attri’
xfsprogs-6.15.0/logprint/log_redo.c:996:12: branch_false: following ‘false’ branch (when ‘name_len == 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1004:12: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1004:12: branch_false: following ‘false’ branch (when ‘new_name_len == 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1012:12: branch_false: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1012:12: branch_true: following ‘true’ branch (when ‘value_len != 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1013:31: branch_true: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1021:12: branch_true: following ‘true’ branch (when ‘new_value_len != 0’)...
xfsprogs-6.15.0/logprint/log_redo.c:1022:31: branch_true: ...to here
xfsprogs-6.15.0/logprint/log_redo.c:1026:17: throw: if ‘print_or_dump’ throws an exception...
xfsprogs-6.15.0/logprint/log_redo.c:1026:17: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/1)
# 1024|   		region++;
# 1025|   		printf(_("ATTRI:  newvalue len:%u\n"), new_value_len);
# 1026|-> 		print_or_dump((char *)item->ri_buf[region].i_addr, len);
# 1027|   		new_value_ptr = item->ri_buf[region].i_addr;
# 1028|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def11]
xfsprogs-6.15.0/mkfs/proto.c:695:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘fname’
xfsprogs-6.15.0/mkfs/proto.c:933:1: enter_function: entry to ‘parse_proto’
xfsprogs-6.15.0/mkfs/proto.c:940:9: call_function: calling ‘parseproto’ from ‘parse_proto’
#  693|   	memset(&creds, 0, sizeof(creds));
#  694|   	mstr = getstr(pp);
#  695|-> 	switch (mstr[0]) {
#  696|   	case '-':
#  697|   		fmt = IF_REGULAR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:1632:13: warning[-Wanalyzer-malloc-leak]: leak of ‘getstr(value, & nopts, 1)’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:2091:1: enter_function: entry to ‘naming_opts_parser’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:2102:25: call_function: calling ‘getstr’ from ‘naming_opts_parser’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:2102:25: return_function: returning to ‘naming_opts_parser’ from ‘getstr’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:2103:20: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:2107:52: branch_false: ...to here
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:2107:52: call_function: calling ‘getnum’ from ‘naming_opts_parser’
# 1630|   	int			i;
# 1631|   
# 1632|-> 	if (sp->index != index) {
# 1633|   		fprintf(stderr,
# 1634|   	_("Developer screwed up option parsing (%d/%d)! Please report!\n"),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5835:23: warning[-Wanalyzer-malloc-leak]: leak of ‘xi.data.name’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5674:1: enter_function: entry to ‘main’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5820:12: branch_false: following ‘false’ branch...
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5823:19: branch_false: ...to here
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5823:19: branch_true: following ‘true’ branch...
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5824:43: branch_true: ...to here
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5824:32: call_function: calling ‘getstr’ from ‘main’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5824:32: return_function: returning to ‘main’ from ‘getstr’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5833:9: call_function: calling ‘cfgfile_parse’ from ‘main’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5833:9: return_function: returning to ‘main’ from ‘cfgfile_parse’
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5835:23: throw: if ‘setup_proto’ throws an exception...
xfsprogs-6.15.0/mkfs/xfs_mkfs.c:5835:23: danger: ‘xi.data.name’ leaks here; was allocated at [(23)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/22)
# 5833|   	cfgfile_parse(&cli);
# 5834|   
# 5835|-> 	protostring = setup_proto(cli.protofile);
# 5836|   
# 5837|   	/*

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
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-83.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-namexfsprogs-6.17.0-1.fc44
diffbase-store-results-to/tmp/tmpwgd8ulpr/xfsprogs-6.17.0-1.fc44.tar.xz
diffbase-time-created2026-01-08 22:15:27
diffbase-time-finished2026-01-08 22:18:46
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpwgd8ulpr/xfsprogs-6.17.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpwgd8ulpr/xfsprogs-6.17.0-1.fc44.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-83.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-namexfsprogs-6.15.0-3.fc43
store-results-to/tmp/tmp5tkzhnu7/xfsprogs-6.15.0-3.fc43.tar.xz
time-created2026-01-08 22:11:00
time-finished2026-01-08 22:14:50
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp5tkzhnu7/xfsprogs-6.15.0-3.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp5tkzhnu7/xfsprogs-6.15.0-3.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9