fix(esp_wifi): Prevent memory overflow in WPS

This commit is contained in:
Kapil Gupta
2024-09-21 14:38:09 +05:30
parent 11ffeab864
commit 6699f1a51c

View File

@ -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;
}