Skip to content

Commit 3ba486a

Browse files
committed
test(log): fixed buffer overflow in log host test fixture
1 parent dbe3c11 commit 3ba486a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/log/host_test/log_test/main/log_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct PrintFixture : BasicLogFixture {
104104
int print_to_buffer(const char *format, va_list args)
105105
{
106106
// Added support for multi-line log, for example ESP_LOG_BUFFER...
107-
int ret = vsnprintf(&print_buffer[buffer_idx], BUFFER_SIZE, format, args);
107+
int ret = vsnprintf(&print_buffer[buffer_idx], BUFFER_SIZE - buffer_idx, format, args);
108108
buffer_idx += ret;
109109
return ret;
110110
}

0 commit comments

Comments
 (0)