]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Constrain rcodes mapped to eap codes (CID #1503933) (#4620)
authorJames Jones <jejones3141@gmail.com>
Tue, 19 Jul 2022 12:37:59 +0000 (07:37 -0500)
committerGitHub <noreply@github.com>
Tue, 19 Jul 2022 12:37:59 +0000 (08:37 -0400)
Coverity notices that there are rlm_rcode_t values that
exceed the bounds on rcode_to_eap_code[].

src/lib/eap_aka_sim/module.c

index eed04c7861cfca46b4faad037fb6aa577f0f184c..a69dfd09c9332a7603bf9a1adb44ae66b1f6c1b9 100644 (file)
@@ -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.