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 7c3d2e4828)
This commit is contained in:
Jeremy Huddleston Sequoia 2012-08-16 19:42:54 -07:00
parent 2141f21d51
commit 0754f74a53

View file

@ -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;
}