diff --git a/src/bin/debug/strace/strace.cpp b/src/bin/debug/strace/strace.cpp index 045ba20c2f..9f66509475 100644 --- a/src/bin/debug/strace/strace.cpp +++ b/src/bin/debug/strace/strace.cpp @@ -323,6 +323,9 @@ print_to_string(char **_buffer, int32 *_length, const char *format, ...) ssize_t length = vsnprintf(*_buffer, *_length, format, list); va_end(list); + if (length > *_length) + length = *_length; + *_buffer += length; *_length -= length; }