[api] Fix heap-buffer-overflow in protobuf message dump for StringRef (#14721)
This commit is contained in:
1 parent
23c7e0f803
commit
14c3e2d9d9
2 files changed
+3
-3
No files matched your search
@@ -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("'");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user