From: James Jones Date: Tue, 19 Jul 2022 12:37:59 +0000 (-0500) Subject: Constrain rcodes mapped to eap codes (CID #1503933) (#4620) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1fa8ff5191ea0f8599729d7b006db05095b949e;p=thirdparty%2Ffreeradius-server.git Constrain rcodes mapped to eap codes (CID #1503933) (#4620) Coverity notices that there are rlm_rcode_t values that exceed the bounds on rcode_to_eap_code[]. --- diff --git a/src/lib/eap_aka_sim/module.c b/src/lib/eap_aka_sim/module.c index eed04c7861c..a69dfd09c93 100644 --- a/src/lib/eap_aka_sim/module.c +++ b/src/lib/eap_aka_sim/module.c @@ -91,6 +91,8 @@ static unlang_action_t mod_encode(rlm_rcode_t *p_result, module_ctx_t const *mct return UNLANG_ACTION_CALCULATE_RESULT; } + fr_assert(rcode < RLM_MODULE_NUMCODES); + /* * If there is a subtype vp, verify the return * code allows us send EAP-SIM/AKA/AKA' data back.