diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index b9dd2ab3bdbb..c9abe83818da 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -2221,7 +2221,7 @@ sir_validate_and_rectify_ies(tpAniSirGlobal mac_ctx, uint32_t *missing_rsn_bytes) { uint32_t length = SIZE_OF_FIXED_PARAM; - uint8_t *ref_frame; + uint8_t *ref_frame = NULL; /* Frame contains atleast one IE */ if (frame_bytes > (SIZE_OF_FIXED_PARAM + @@ -2241,7 +2241,7 @@ sir_validate_and_rectify_ies(tpAniSirGlobal mac_ctx, * Capability with junk value. To avoid this, add RSN * Capability value with default value. */ - if ((*ref_frame == RSNIEID) && + if (ref_frame && (*ref_frame == RSNIEID) && (length == (frame_bytes + RSNIE_CAPABILITY_LEN))) { /* Assume RSN Capability as 00 */