From b0c5b1ddbb5c8fb20906f16797c76c3dc574c29d Mon Sep 17 00:00:00 2001 From: cptskippy Date: Fri, 31 May 2024 16:17:11 +0000 Subject: [PATCH] bounding buffer copy --- esphome/components/ld2415h/ld2415h.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/ld2415h/ld2415h.cpp b/esphome/components/ld2415h/ld2415h.cpp index 4985432d9d..5b21b1d676 100644 --- a/esphome/components/ld2415h/ld2415h.cpp +++ b/esphome/components/ld2415h/ld2415h.cpp @@ -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."); }