add null termination when writing http auth info

This commit is contained in:
Siwat Sirichai 2023-12-03 14:52:04 +07:00
parent dae545a63e
commit d489126f14
1 changed files with 2 additions and 2 deletions

View File

@ -458,9 +458,9 @@ void ota_begin()
if(!value.compareTo("yes")) if(!value.compareTo("yes"))
use_auth = true; use_auth = true;
} else if(!arg.compareTo("webui_username")) { } else if(!arg.compareTo("webui_username")) {
ESPMega_FRAM.write(EEPROM_ADDRESS_WEBUI_USERNAME, (uint8_t *)value.c_str(), value.length()); ESPMega_FRAM.write(EEPROM_ADDRESS_WEBUI_USERNAME, (uint8_t *)value.c_str(), value.length()+1);
} else if(!arg.compareTo("webui_password")) { } else if(!arg.compareTo("webui_password")) {
ESPMega_FRAM.write(EEPROM_ADDRESS_WEBUI_PASSWORD, (uint8_t *)value.c_str(), value.length()); ESPMega_FRAM.write(EEPROM_ADDRESS_WEBUI_PASSWORD, (uint8_t *)value.c_str(), value.length()+1);
} }
} }
set_mqtt_useauth(use_auth); set_mqtt_useauth(use_auth);