summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2012-08-16 19:42:54 -0700
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2012-08-19 08:52:06 -0700
commit0754f74a538ca59e45a39fefa2d90b9d3bc822dd (patch)
tree079542421378271ce1473867a981e9ca444499ab
parent2141f21d51b0787c8d287bb50d01a6a81e61a634 (diff)
XQuartz: console_redirect: Properly zero-out the tail of the array on realloc()
We forgot to multiply by sizeof(), so it wasn't fully zeroed out. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> (cherry picked from commit 7c3d2e4828deb4e8ec38e8ef88d6f92b2d931033)
-rw-r--r--hw/xquartz/console_redirect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c
index 30e397a6b..8fdce4699 100644
--- a/hw/xquartz/console_redirect.c
+++ b/hw/xquartz/console_redirect.c
@@ -365,8 +365,8 @@ xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd)
BLOCK_DONE;
}
redirect_fds = new_array;
- memset(redirect_fds + n_redirect_fds, 0, new_n -
- n_redirect_fds);
+ memset(redirect_fds + n_redirect_fds, 0, (new_n -
+ n_redirect_fds) * sizeof(*redirect_fds));
n_redirect_fds = new_n;
}