Task #936 - fixed.err

back to task #936
download
Error: CLANG_WARNING:
nvme-cli-2.8-build/nvme-cli-2.8/fabrics.c:229:2: warning[core.StackAddressEscape]: Address of stack memory associated with local variable 'id' is still referred to by the stack variable 'trcfg' upon returning to the caller.  This will be a dangling reference
#  227|   
#  228|   	trcfg->subsysnqn = id.subnqn;
#  229|-> 	return __create_discover_ctrl(r, h, cfg, trcfg);
#  230|   }
#  231|   

Error: GCC_ANALYZER_WARNING (CWE-401):
nvme-cli-2.8-build/nvme-cli-2.8/fabrics.c: scope_hint: In function ‘nvmf_check_hostid_and_hostnqn.part.0’
nvme-cli-2.8-build/nvme-cli-2.8/fabrics.c:634:16: warning[-Wanalyzer-malloc-leak]: leak of ‘nvmf_hostid_from_hostnqn(hostnqn)’
#  632|   		return NULL;
#  633|   
#  634|-> 	return strdup(uuid + strlen("uuid:"));
#  635|   }
#  636|   

Error: GCC_ANALYZER_WARNING (CWE-457):
nvme-cli-2.8-build/nvme-cli-2.8/nvme-print-json.c: scope_hint: In function ‘json_phy_rx_eom_log’
nvme-cli-2.8-build/nvme-cli-2.8/nvme-print-json.c:2046:43: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
nvme-cli-2.8-build/nvme-cli-2.8/nvme.h:30: included_from: Included from here.
nvme-cli-2.8-build/nvme-cli-2.8/nvme-print.h:5: included_from: Included from here.
nvme-cli-2.8-build/nvme-cli-2.8/nvme-print-json.c:7: included_from: Included from here.
nvme-cli-2.8-build/nvme-cli-2.8/nvme-print-json.c:1987:45: note: in expansion of macro ‘json_create_object’
nvme-cli-2.8-build/nvme-cli-2.8/nvme-print-json.c:1969:9: note: in expansion of macro ‘obj_add_str’
nvme-cli-2.8-build/nvme-cli-2.8/nvme-print-json.c:1969:9: note: in expansion of macro ‘obj_add_str’
# 2044|   		for (i = 0; i < log->nd; i++) {
# 2045|   			/* Free any Printable Eye strings allocated */
# 2046|-> 			if (allocated_eyes[i])
# 2047|   				free(allocated_eyes[i]);
# 2048|   		}

Error: GCC_ANALYZER_WARNING (CWE-457):
nvme-cli-2.8-build/nvme-cli-2.8/nvme.c: scope_hint: In function ‘get_feature_id_changed’
nvme-cli-2.8-build/nvme-cli-2.8/nvme.c:4587:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘result’
# 4585|   	if (err || !changed || err_def || result != result_def ||
# 4586|   	    (buf && buf_def && !strcmp(buf, buf_def)))
# 4587|-> 		get_feature_id_print(cfg, err, result, buf);
# 4588|   
# 4589|   	free(buf);

Error: GCC_ANALYZER_WARNING (CWE-775):
nvme-cli-2.8-build/nvme-cli-2.8/nvme.c: scope_hint: In function ‘fw_download’
nvme-cli-2.8-build/nvme-cli-2.8/nvme.c:4856:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cfg.fw, 0)’
# 4854|   		return err;
# 4855|   
# 4856|-> 	fw_fd = open(cfg.fw, O_RDONLY);
# 4857|   	cfg.offset <<= 2;
# 4858|   	if (fw_fd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401):
nvme-cli-2.8-build/nvme-cli-2.8/nvme.c: scope_hint: In function ‘gen_dhchap_key’
nvme-cli-2.8-build/nvme-cli-2.8/nvme.c:8394:24: warning[-Wanalyzer-malloc-leak]: leak of ‘raw_secret’
# 8392|   	err = argconfig_parse(argc, argv, desc, opts);
# 8393|   	if (err)
# 8394|-> 		return err;
# 8395|   
# 8396|   	if (cfg.hmac > 3) {

Error: GCC_ANALYZER_WARNING (CWE-401):
nvme-cli-2.8-build/nvme-cli-2.8/nvme.c: scope_hint: In function ‘gen_tls_key’
nvme-cli-2.8-build/nvme-cli-2.8/nvme.c:8627:24: warning[-Wanalyzer-malloc-leak]: leak of ‘raw_secret’
# 8625|   	err = argconfig_parse(argc, argv, desc, opts);
# 8626|   	if (err)
# 8627|-> 		return err;
# 8628|   	if (cfg.hmac < 1 || cfg.hmac > 2) {
# 8629|   		nvme_show_error("Invalid HMAC identifier %u", cfg.hmac);

Error: CLANG_WARNING:
nvme-cli-2.8-build/nvme-cli-2.8/plugins/sed/sedopal_cmd.c:505:3: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  503|   		rc = -1;
#  504|   	} else
#  505|-> 		sedopal_print_locking_features(locking_flags);
#  506|   
#  507|   	return rc;

Error: GCC_ANALYZER_WARNING (CWE-457):
nvme-cli-2.8-build/nvme-cli-2.8/plugins/sed/sedopal_cmd.c: scope_hint: In function ‘sedopal_cmd_discover’
nvme-cli-2.8-build/nvme-cli-2.8/plugins/sed/sedopal_cmd.c:505:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘locking_flags’
/usr/include/sys/types.h:176: included_from: Included from here.
nvme-cli-2.8-build/nvme-cli-2.8/plugins/sed/sedopal_cmd.c:10: included_from: Included from here.
#  503|   		rc = -1;
#  504|   	} else
#  505|-> 		sedopal_print_locking_features(locking_flags);
#  506|   
#  507|   	return rc;

Error: COMPILER_WARNING (CWE-457):
nvme-cli-2.8-build/nvme-cli-2.8/plugins/sed/sedopal_cmd.c: scope_hint: In function ‘sedopal_cmd_discover’
nvme-cli-2.8-build/nvme-cli-2.8/plugins/sed/sedopal_cmd.c:505:17: warning[-Wmaybe-uninitialized]: ‘locking_flags’ may be used uninitialized
#  505 |                 sedopal_print_locking_features(locking_flags);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvme-cli-2.8-build/nvme-cli-2.8/plugins/sed/sedopal_cmd.c:458:17: note: ‘locking_flags’ was declared here
#  458 |         uint8_t locking_flags;
#      |                 ^~~~~~~~~~~~~
#  503|   		rc = -1;
#  504|   	} else
#  505|-> 		sedopal_print_locking_features(locking_flags);
#  506|   
#  507|   	return rc;