From 3ba486a02e0de36f403a5d0731600e7ee57a9d86 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Wed, 2 Apr 2025 11:19:33 +0800 Subject: [PATCH] test(log): fixed buffer overflow in log host test fixture --- components/log/host_test/log_test/main/log_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/log/host_test/log_test/main/log_test.cpp b/components/log/host_test/log_test/main/log_test.cpp index a26187a4f7..d80eb68077 100644 --- a/components/log/host_test/log_test/main/log_test.cpp +++ b/components/log/host_test/log_test/main/log_test.cpp @@ -104,7 +104,7 @@ private: int print_to_buffer(const char *format, va_list args) { // Added support for multi-line log, for example ESP_LOG_BUFFER... - int ret = vsnprintf(&print_buffer[buffer_idx], BUFFER_SIZE, format, args); + int ret = vsnprintf(&print_buffer[buffer_idx], BUFFER_SIZE - buffer_idx, format, args); buffer_idx += ret; return ret; }