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

This commit is contained in:
J. Nick Koston authored and Jesse Hills committed 2026-03-16 09:25:20 +13:00
1 parent 23c7e0f803
commit 14c3e2d9d9
2 files changed
+3 -3

No files matched your search

+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("'");
}