summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2017-08-07 09:06:22 -0700
committerDave Watson <davejwatson@fb.com>2017-08-07 09:07:20 -0700
commitcc0c170f535deadb48e285326a42d3fafabf411d (patch)
tree5956d6fb1e502d846105d851c21a80751cb8a45f
parent23c3f24ea6d9fcf6a9d7a64b2c192f764aaf5f23 (diff)
downloadlibunwind-cc0c170f535deadb48e285326a42d3fafabf411d.tar.gz
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.
-rw-r--r--tests/test-coredump-unwind.c2
1 files changed, 1 insertions, 1 deletions
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)