From a1f8516e603c930e3cf288b3f7d60b1031334e68 Mon Sep 17 00:00:00 2001 From: Hajo Noerenberg Date: Mon, 26 Feb 2024 21:35:35 +0100 Subject: [PATCH] [realtek-ambz] Fix crash after WiFi scan (#258) --- cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp b/cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp index 95408815d..52d1cdafc 100644 --- a/cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp +++ b/cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp @@ -24,6 +24,7 @@ static rtw_result_t scanHandler(rtw_scan_handler_result_t *result) { if (cls->scanAlloc(last) < last) { return RTW_SUCCESS; } + last--; scan->ap[last].ssid = strdup((char *)net->SSID.val); scan->ap[last].auth = securityTypeToAuthMode(net->security);