From 6699f1a51c58445aa08e2e1b83d4331cf745af67 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Sat, 21 Sep 2024 14:38:09 +0530 Subject: [PATCH] fix(esp_wifi): Prevent memory overflow in WPS --- components/wpa_supplicant/esp_supplicant/src/esp_wps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index fbe9cd3b83..0e9e0cbdc1 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -1366,7 +1366,7 @@ void wifi_station_wps_eapol_start_handle(void *data, void *user_ctx) static int save_credentials_cb(void *ctx, const struct wps_credential *cred) { struct wps_credential *creds; - if (!gWpsSm || !cred || gWpsSm->ap_cred_cnt > MAX_CRED_COUNT) { + if (!gWpsSm || !cred || gWpsSm->ap_cred_cnt >= MAX_CRED_COUNT) { return ESP_FAIL; }