From bed610fcae41ddfe21fa9acde599b17d1d15f5d1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:44 -0700 Subject: [PATCH] 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 Reviewed-by: Keith Packard Tested-by: Daniel Stone --- os/io.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; }