From f9123570dbe81fdea4e38e7be9775cf926ed1eb3 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 14 Feb 2017 18:01:17 +0000 Subject: Set padding bytes to 0 in WriteToClient commit bed610fcae41ddfe21fa9acde599b17d1d15f5d1 Author: Alan Coopersmith Date: Mon Jul 9 19:12:44 2012 -0700 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 Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/os/io.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index 78f450b63..075eb677c 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -1003,7 +1003,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); } -- cgit v1.2.3