ndctl-80-1.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-415): [#def1]
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3366:17: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*cmd.query_cmd’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:26: included_from: Included from here.
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:15: included_from: Included from here.
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:24: included_from: Included from here.
ndctl-80-build/ndctl-80/util/log.h:46:32: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:57:24: note: in expansion of macro ‘log_err’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3656:17: note: in expansion of macro ‘err’
# 3364|   		return;
# 3365|   	if (--cmd->refcount == 0) {
# 3366|-> 		free(cmd->query_cmd);
# 3367|   		free(cmd->send_cmd);
# 3368|   		free(cmd->input_payload);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3367:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-80-build/ndctl-80/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3520:9: note: in expansion of macro ‘dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-80-build/ndctl-80/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3540:17: note: in expansion of macro ‘dbg’
ndctl-80-build/ndctl-80/util/log.h:46:32: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:57:24: note: in expansion of macro ‘log_err’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:4520:17: note: in expansion of macro ‘err’
ndctl-80-build/ndctl-80/util/log.h:46:32: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:57:24: note: in expansion of macro ‘log_err’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:4520:17: note: in expansion of macro ‘err’
# 3365|   	if (--cmd->refcount == 0) {
# 3366|   		free(cmd->query_cmd);
# 3367|-> 		free(cmd->send_cmd);
# 3368|   		free(cmd->input_payload);
# 3369|   		free(cmd->output_payload);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3566:43: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-80-build/ndctl-80/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3520:9: note: in expansion of macro ‘dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-80-build/ndctl-80/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3540:17: note: in expansion of macro ‘dbg’
# 3564|   		if (!cmd->input_payload)
# 3565|   			return -ENOMEM;
# 3566|-> 		cmd->send_cmd->in.payload = (u64)cmd->input_payload;
# 3567|   	} else {
# 3568|   		/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:4262:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘get_lsa’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-80-build/ndctl-80/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3520:9: note: in expansion of macro ‘dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-80-build/ndctl-80/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3540:17: note: in expansion of macro ‘dbg’
# 4260|   
# 4261|   	get_lsa = (struct cxl_cmd_get_lsa_in *)cmd->send_cmd->in.payload;
# 4262|-> 	get_lsa->offset = cpu_to_le32(offset);
# 4263|   	get_lsa->length = cpu_to_le32(length);
# 4264|   	return cmd;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:4368:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 4366|   			CXL_MEM_COMMAND_ID_SET_PARTITION_INFO);
# 4367|   
# 4368|-> 	setpart = cmd->input_payload;
# 4369|   	setpart->volatile_size = cpu_to_le64(volatile_size)
# 4370|   					/ CXL_CAPACITY_MULTIPLIER;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:4369:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘setpart’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-80-build/ndctl-80/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3520:9: note: in expansion of macro ‘dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3389:16: note: in expansion of macro ‘struct_size’
ndctl-80-build/ndctl-80/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-80-build/ndctl-80/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-80-build/ndctl-80/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-80-build/ndctl-80/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-80-build/ndctl-80/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-80-build/ndctl-80/cxl/lib/libcxl.c:3540:17: note: in expansion of macro ‘dbg’
# 4367|   
# 4368|   	setpart = cmd->input_payload;
# 4369|-> 	setpart->volatile_size = cpu_to_le64(volatile_size)
# 4370|   					/ CXL_CAPACITY_MULTIPLIER;
# 4371|   	return cmd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
ndctl-80-build/ndctl-80/cxl/memdev.c:1005:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_in’
# 1003|   	if (err == argc) {
# 1004|   		usage_with_options(u, options);
# 1005|-> 		return -EINVAL;
# 1006|   	}
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
ndctl-80-build/ndctl-80/cxl/memdev.c: scope_hint: In function ‘memdev_action’
ndctl-80-build/ndctl-80/cxl/memdev.c:1005:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_out’
# 1003|   	if (err == argc) {
# 1004|   		usage_with_options(u, options);
# 1005|-> 		return -EINVAL;
# 1006|   	}
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
ndctl-80-build/ndctl-80/cxl/memdev.c:1005:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_in’
# 1003|   	if (err == argc) {
# 1004|   		usage_with_options(u, options);
# 1005|-> 		return -EINVAL;
# 1006|   	}
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
ndctl-80-build/ndctl-80/cxl/memdev.c:1005:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_out’
# 1003|   	if (err == argc) {
# 1004|   		usage_with_options(u, options);
# 1005|-> 		return -EINVAL;
# 1006|   	}
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
ndctl-80-build/ndctl-80/daxctl/acpi.c: scope_hint: In function ‘read_nfit’
ndctl-80-build/ndctl-80/daxctl/acpi.c:159:40: warning[-Wanalyzer-malloc-leak]: leak of ‘ent’
ndctl-80-build/ndctl-80/daxctl/acpi.c: scope_hint: In function ‘read_nfit’
#  157|   	buf = nfit + 1;
#  158|   	while (length) {
#  159|-> 		struct nfit_ent *ent = calloc(1, sizeof(*ent));
#  160|   
#  161|   		if (!ent) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
ndctl-80-build/ndctl-80/daxctl/acpi.c: scope_hint: In function ‘read_srat’
ndctl-80-build/ndctl-80/daxctl/acpi.c:218:40: warning[-Wanalyzer-malloc-leak]: leak of ‘ent’
ndctl-80-build/ndctl-80/daxctl/acpi.c: scope_hint: In function ‘read_srat’
#  216|   	buf = srat + 1;
#  217|   	while (length) {
#  218|-> 		struct srat_ent *ent = calloc(1, sizeof(*ent));
#  219|   
#  220|   		if (!ent) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def13]
ndctl-80-build/ndctl-80/ndctl/dimm.c: scope_hint: In function ‘dimm_action’
ndctl-80-build/ndctl-80/ndctl/dimm.c:1329:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_in’
# 1327|   	if (err == argc) {
# 1328|   		usage_with_options(u, options);
# 1329|-> 		return -EINVAL;
# 1330|   	}
# 1331|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
ndctl-80-build/ndctl-80/ndctl/dimm.c:1329:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_out’
# 1327|   	if (err == argc) {
# 1328|   		usage_with_options(u, options);
# 1329|-> 		return -EINVAL;
# 1330|   	}
# 1331|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
ndctl-80-build/ndctl-80/ndctl/dimm.c:1329:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_in’
# 1327|   	if (err == argc) {
# 1328|   		usage_with_options(u, options);
# 1329|-> 		return -EINVAL;
# 1330|   	}
# 1331|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
ndctl-80-build/ndctl-80/ndctl/dimm.c:1329:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_out’
# 1327|   	if (err == argc) {
# 1328|   		usage_with_options(u, options);
# 1329|-> 		return -EINVAL;
# 1330|   	}
# 1331|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
ndctl-80-build/ndctl-80/ndctl/lib/libndctl.c: scope_hint: In function ‘add_dax’
ndctl-80-build/ndctl-80/ndctl/lib/libndctl.c:5634:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dax’
# 5632|   		return NULL;
# 5633|   
# 5634|-> 	pfn->id = id;
# 5635|   	pfn->region = region;
# 5636|   	if (!__add_pfn(pfn, dax_base)) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def18]
ndctl-80-build/ndctl-80/ndctl/load-keys.c: scope_hint: In function ‘load_keys’
ndctl-80-build/ndctl-80/ndctl/load-keys.c:187:14: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘keypath’ where non-null expected
ndctl-80-build/ndctl-80/ndctl/load-keys.c:7: included_from: Included from here.
/usr/include/unistd.h:517:12: note: argument 1 of ‘chdir’ must be non-null
#  185|   	int rc;
#  186|   
#  187|-> 	rc = chdir(keypath);
#  188|   	if (rc < 0) {
#  189|   		fprintf(stderr, "Change current work dir to %s failed: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-688): [#def19]
ndctl-80-build/ndctl-80/util/parse-options.c: scope_hint: In function ‘get_value’
ndctl-80-build/ndctl-80/util/parse-options.c:151:38: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/features.h:511: 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.
ndctl-80-build/ndctl-80/util/parse-options.c:6: included_from: Included from here.
/usr/include/stdlib.h:215:17: note: argument 1 of ‘strtol’ must be non-null
#  149|   		if (get_arg(p, opt, flags, &arg))
#  150|   			return -1;
#  151|-> 		*(int *)opt->value = strtol(arg, (char **)&s, 10);
#  152|   		if (*s)
#  153|   			return opterror(opt, "expects a numerical value", flags);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def20]
ndctl-80-build/ndctl-80/util/parse-options.c:167:47: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/stdlib.h:215:17: note: argument 1 of ‘strtol’ must be non-null
#  165|   		if (get_arg(p, opt, flags, &arg))
#  166|   			return -1;
#  167|-> 		*(unsigned int *)opt->value = strtol(arg, (char **)&s, 10);
#  168|   		if (*s)
#  169|   			return opterror(opt, "expects a numerical value", flags);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def21]
ndctl-80-build/ndctl-80/util/parse-options.c:183:39: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/stdlib.h:215:17: note: argument 1 of ‘strtol’ must be non-null
#  181|   		if (get_arg(p, opt, flags, &arg))
#  182|   			return -1;
#  183|-> 		*(long *)opt->value = strtol(arg, (char **)&s, 10);
#  184|   		if (*s)
#  185|   			return opterror(opt, "expects a numerical value", flags);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def22]
ndctl-80-build/ndctl-80/util/parse-options.c:199:43: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/stdlib.h:243:31: note: argument 1 of ‘strtoull’ must be non-null
#  197|   		if (get_arg(p, opt, flags, &arg))
#  198|   			return -1;
#  199|-> 		*(uint64_t *)opt->value = strtoull(arg, (char **)&s, 10);
#  200|   		if (*s)
#  201|   			return opterror(opt, "expects a numerical value", flags);

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-133.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namendctl-80-1.fc42
store-results-to/tmp/tmppd719mjz/ndctl-80-1.fc42.tar.xz
time-created2024-11-13 02:04:26
time-finished2024-11-13 02:06:13
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmppd719mjz/ndctl-80-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmppd719mjz/ndctl-80-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9