Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Initialize local variable for AP config
The AP configuration variable wasn't initialized, so the fields contained random data. Then, they were filled using memcpy() with the size of the data to copy, leaving the remainder of the fields containing random data. For example, the pwd variable containing the entered password was copied without null termination into the pwd field, and the rest of the pwd field contained random data. This caused connection failures depending on the content of the random data.
  • Loading branch information
alrvid authored Nov 28, 2024
commit 1085b2408a4cbae28479e98e3670b48e5d87d352
2 changes: 1 addition & 1 deletion libraries/ESPhost/examples/ESP32_TEST/ESP32_TEST.ino
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void connectAccessPoint() {
int i = stoi(ap_str);

Serial.println(">>> [APP]: Connecting to Access Point");
WifiApCfg_t ap;
WifiApCfg_t ap{};
memcpy(ap.ssid,access_point_list[i].ssid,SSID_LENGTH);
memcpy(ap.pwd,pwd.c_str(),pwd.size());
memcpy(ap.bssid,access_point_list[i].bssid,BSSID_LENGTH);
Expand Down