Skip to content

Commit 435f235

Browse files
committed
minor fixes to rlm_eap
1 parent 33cde27 commit 435f235

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/modules/rlm_eap/rlm_eap.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static eap_type_t eap_process_nak(module_ctx_t const *mctx, request_t *request,
234234
unsigned int i, s_i = 0;
235235
fr_pair_t *vp = NULL;
236236
eap_type_t method = FR_EAP_METHOD_INVALID;
237-
eap_type_t sanitised[nak->length];
237+
eap_type_t sanitised[FR_EAP_METHOD_MAX];
238238

239239
/*
240240
* The NAK data is the preferred EAP type(s) of
@@ -254,7 +254,8 @@ static eap_type_t eap_process_nak(module_ctx_t const *mctx, request_t *request,
254254
* Do a loop over the contents of the NAK, only moving entries
255255
* which are valid to the sanitised array.
256256
*/
257-
for (i = 0; i < nak->length; i++) {
257+
for (i = 0; (i < nak->length) && (i < FR_EAP_METHOD_MAX); i++) {
258+
258259
/*
259260
* Type 0 is valid, and means there are no
260261
* common choices.
@@ -551,7 +552,7 @@ static ssize_t eap_identity_is_nai_with_realm(char const *identity)
551552
return identity - end;
552553
}
553554

554-
if ((realm - 1) == p) {
555+
if ((realm + 1) == p) {
555556
fr_strerror_printf("Identity is not valid. "
556557
"Realm is missing label between realm separator '@' and label separator '.'");
557558
return identity - realm;

0 commit comments

Comments
 (0)