aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/os
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2017-02-14 18:01:17 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-03-20 10:50:58 +0100
commitf9123570dbe81fdea4e38e7be9775cf926ed1eb3 (patch)
treee5475cb20c043317b4b8533b6426bb66fbcea994 /nx-X11/programs/Xserver/os
parent2ecd2a006866bd7053536c04b195319a548c6ca2 (diff)
downloadnx-libs-f9123570dbe81fdea4e38e7be9775cf926ed1eb3.tar.gz
nx-libs-f9123570dbe81fdea4e38e7be9775cf926ed1eb3.tar.bz2
nx-libs-f9123570dbe81fdea4e38e7be9775cf926ed1eb3.zip
Set padding bytes to 0 in WriteToClient
commit bed610fcae41ddfe21fa9acde599b17d1d15f5d1 Author: Alan Coopersmith <alan.coopersmith@oracle.com> 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 <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org> Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Diffstat (limited to 'nx-X11/programs/Xserver/os')
-rw-r--r--nx-X11/programs/Xserver/os/io.c6
1 files changed, 5 insertions, 1 deletions
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);
}