From d088698324d5e71cb93ccd429f084729ba07872c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C3=85strand?= Date: Fri, 13 Feb 2009 10:23:28 +0100 Subject: Backport: xserver: Avoid sending uninitialized padding data over the network Signed-off-by: Peter Hutterer --- nx-X11/programs/Xserver/Xi/listdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/Xi/listdev.c') diff --git a/nx-X11/programs/Xserver/Xi/listdev.c b/nx-X11/programs/Xserver/Xi/listdev.c index b7eed86b7..6228352f5 100644 --- a/nx-X11/programs/Xserver/Xi/listdev.c +++ b/nx-X11/programs/Xserver/Xi/listdev.c @@ -114,6 +114,7 @@ ProcXListInputDevices (client) REQUEST_SIZE_MATCH(xListInputDevicesReq); + memset(&rep, 0, sizeof(xListInputDevicesReply)); rep.repType = X_Reply; rep.RepType = X_ListInputDevices; rep.length = 0; @@ -128,7 +129,7 @@ ProcXListInputDevices (client) SizeDeviceInfo (d, &namesize, &size); total_length = numdevs * sizeof (xDeviceInfo) + size + namesize; - devbuf = (char *) xalloc (total_length); + devbuf = (char *) xcalloc (1, total_length); classbuf = devbuf + (numdevs * sizeof (xDeviceInfo)); namebuf = classbuf + size; savbuf = devbuf; -- cgit v1.2.3