From 04e6c4cc50fff20f2f79bc757f7883ad7d8f06a4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 20 Jun 2015 23:29:57 +0300 Subject: [PATCH] Fix SAE group selection in an error case The sae_groups parameter is zero terminated array, not -1 terminated, so must check the value against <= 0 to break out from the loop. Signed-off-by: Jouni Malinen --- wpa_supplicant/sme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 2f4dc5aa7..234670ae2 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -67,7 +67,7 @@ static int sme_set_sae_group(struct wpa_supplicant *wpa_s) for (;;) { int group = groups[wpa_s->sme.sae_group_index]; - if (group < 0) + if (group <= 0) break; if (sae_set_group(&wpa_s->sme.sae, group) == 0) { wpa_dbg(wpa_s, MSG_DEBUG, "SME: Selected SAE group %d",