[api] Fix heap-buffer-overflow in protobuf message dump for StringRef (#14721)

This commit is contained in:
J. Nick Koston
2026-03-12 07:16:53 -10:00
committed by GitHub
parent 186ca4e458
commit 05d285ba86
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ namespace esphome::api {
static inline void append_quoted_string(DumpBuffer &out, const StringRef &ref) {
out.append("'");
if (!ref.empty()) {
out.append(ref.c_str());
out.append(ref.c_str(), ref.size());
}
out.append("'");
}