1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-08 06:00:56 +00:00

bounding buffer copy

This commit is contained in:
cptskippy 2024-05-31 16:17:11 +00:00
parent 28bb6f5507
commit b0c5b1ddbb

View File

@ -291,7 +291,7 @@ void LD2415HComponent::parse_firmware_() {
++fw;
// Copy string into firmware
std::strcpy(this->firmware_, fw);
std::strncpy(this->firmware_, fw, sizeof(this->firmware_));
} else {
ESP_LOGE(TAG, "Firmware value invalid.");
}