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.");
}