From cc0c170f535deadb48e285326a42d3fafabf411d Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Mon, 7 Aug 2017 09:06:22 -0700 Subject: [PATCH] tests: Fix heap overflow in coredump-unwind test We've tried to run slightly modified test-coredump-unwind.c built with tcmalloc, and it promptly crashed. Attached patch fixes the heap buffer overflow bug which caused it. --- tests/test-coredump-unwind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c index 22fe9e42..53498237 100644 --- a/tests/test-coredump-unwind.c +++ b/tests/test-coredump-unwind.c @@ -137,7 +137,7 @@ static void verror_msg_helper(const char *s, if (flags & LOGMODE_STDIO) { fflush(stdout); - used += write(STDERR_FILENO, msg, used + msgeol_len); + write(STDERR_FILENO, msg, used + msgeol_len); } msg[used] = '\0'; /* remove msg_eol (usually "\n") */ if (flags & LOGMODE_SYSLOG)