From 0ef728d1f23a025477e8e8d3aeb5c3f806384725 Mon Sep 17 00:00:00 2001 From: Patrick Wildt Date: Tue, 18 Jul 2023 21:58:36 +0000 Subject: [PATCH] Initialize variable to quiet compiler finding GCC 12.2.0 believes that the variable secured_context might be used in the switch-case LIBSPDM_DATA_SESSION_SEQUENCE_NUMBER_REQ_DIR without being initialized. This though does not happen because in that case need_session_info_for_data() will return true and secured_context will be set. Change-Id: I1f661115b9a9c27eeddc4238c1887fdd0566b533 Signed-off-by: Patrick Wildt --- library/spdm_common_lib/libspdm_com_context_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/spdm_common_lib/libspdm_com_context_data.c b/library/spdm_common_lib/libspdm_com_context_data.c index c5a9006a6f8..cd47a2b0d46 100644 --- a/library/spdm_common_lib/libspdm_com_context_data.c +++ b/library/spdm_common_lib/libspdm_com_context_data.c @@ -818,7 +818,7 @@ libspdm_return_t libspdm_get_data(void *spdm_context, libspdm_data_type_t data_t void *data, size_t *data_size) { libspdm_context_t *context; - libspdm_secured_message_context_t *secured_context; + libspdm_secured_message_context_t *secured_context = NULL; size_t target_data_size; void *target_data; uint32_t session_id;