mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 15:50:36 -08:00
Fix string copy
strncpy only copies the bytes specified, so if you set a name like "PORTAL" and then want to set a name like "HELLO" the result for apName would be "HELLOL". Instead copy the size of MAX_AP_NAME_SIZE.
This commit is contained in:
committed by
GitHub
parent
9db9c630e4
commit
def6d2d277
@@ -203,7 +203,7 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
|
||||
}
|
||||
|
||||
if (ap_config != "") {
|
||||
strncpy(apName, ap_config.c_str(), strlen(ap_config.c_str()));
|
||||
strncpy(apName, ap_config.c_str(), MAX_AP_NAME_SIZE);
|
||||
this->has_ap = true;
|
||||
Serial.println("ap config set");
|
||||
return true;
|
||||
@@ -304,4 +304,4 @@ void EvilPortal::main(uint8_t scan_mode) {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user