From 3ae665388a432b9718dde49cdd913b5edb3d35ea Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 2 Nov 2023 10:28:51 -0400 Subject: [PATCH] Declare variable outside of case: label --- openair3/NAS/NR_UE/nr_nas_msg_sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index d9f5fb7d18..0c97177a9c 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -985,6 +985,7 @@ static void get_allowed_nssai(nr_nas_msg_snssai_t nssai[8], const uint8_t *pdu_b /* optional fields */ while (pdu_buffer < end) { const int type = *pdu_buffer++; + int length = 0; switch (type) { case 0x77: // 5GS mobile identity pdu_buffer += ntoh_int16_buf(pdu_buffer) + sizeof(uint16_t); @@ -996,7 +997,7 @@ static void get_allowed_nssai(nr_nas_msg_snssai_t nssai[8], const uint8_t *pdu_b break; case 0x15: // allowed NSSAI - const int length = *pdu_buffer++; + length = *pdu_buffer++; parse_allowed_nssai(nssai, pdu_buffer, length); break;