From 204017af9fd45e47f6a6aea3a66652581394a549 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 4582ffb21b..8db973ca79 100644 --- a/components/log/host_test/log_test/main/log_test.cpp +++ b/components/log/host_test/log_test/main/log_test.cpp @@ -95,7 +95,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; }