diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:12:44 -0700 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2012-08-01 17:59:40 -0700 |
commit | f29c0ddd5afc4549e20d72a1d9e4c17276bb4bb1 (patch) | |
tree | 08818505dbabb187e4719d1853b197d84a748f02 | |
parent | eeefadf95ed764755bfb04b107f636c6ae60bdde (diff) |
Set padding bytes to 0 in WriteToClient
Clear them out when needed instead of leaving whatever values were
present in previously sent messages.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit bed610fcae41ddfe21fa9acde599b17d1d15f5d1)
-rw-r--r-- | os/io.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -815,7 +815,11 @@ WriteToClient(ClientPtr who, int count, const void *__buf) NewOutputPending = TRUE; FD_SET(oc->fd, &OutputPending); memmove((char *) oco->buf + oco->count, buf, count); - oco->count += count + padBytes; + oco->count += count; + if (padBytes) { + memset(oco->buf + oco->count, '\0', padBytes); + oco->count += padBytes; + } return count; } |