summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:12:44 -0700
committerKeith Packard <keithp@keithp.com>2012-07-09 22:52:30 -0700
commitbed610fcae41ddfe21fa9acde599b17d1d15f5d1 (patch)
treed52d091b68dcbc4c4d0d6b2004c4e79ab4fc0176 /os
parent1622dd8ab24d2fe7b9908110eb237774d4e03568 (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>
Diffstat (limited to 'os')
-rw-r--r--os/io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/os/io.c b/os/io.c
index b67a5f324..8d0e5cc6f 100644
--- a/os/io.c
+++ b/os/io.c
@@ -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;
}