fix(m1): harden provisioning per F2 review findings

- bound-check the portal option row snprintf against truncation
- guard the pending-credential handoff with the provision mutex
- selftest now restores (or clears) the saved wifi config instead of wiping it
- mark the two conscious error-code ignores
This commit is contained in:
2026-08-31 08:18:30 +08:00
parent 5f7c60c899
commit 2851ac7fc5
3 changed files with 40 additions and 5 deletions
@@ -83,6 +83,7 @@ esp_err_t wifi_service::connect_sta(const char* ssid, const char* password, bool
config.sta.sae_pwe_h2e = WPA3_SAE_PWE_BOTH;
configured_.store(false);
// deliberate ignore: the upcoming set_config/connect supersedes any pending link
esp_wifi_disconnect();
esp_err_t result = esp_wifi_set_config(WIFI_IF_STA, &config);
if (result == ESP_OK) {