xserver: Avoid sending uninitialized padding data over the network

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Åstrand 2009-02-13 10:23:28 +01:00 • committed by Peter Hutterer
commit ddb8d8945d
24 changed files with 86 additions and 16 deletions

View file

@ -116,6 +116,7 @@ ProcXGetExtensionVersion(ClientPtr client)
pXIClient->minor_version = stuff->minorVersion;
} /* else version unknown, leave it at 0.0 */
memset(&rep, 0, sizeof(xGetExtensionVersionReply));
rep.repType = X_Reply;
rep.RepType = X_GetExtensionVersion;
rep.length = 0;

View file

@ -338,6 +338,7 @@ ProcXListInputDevices(ClientPtr client)
REQUEST_SIZE_MATCH(xListInputDevicesReq);
memset(&rep, 0, sizeof(xListInputDevicesReply));
rep.repType = X_Reply;
rep.RepType = X_ListInputDevices;
rep.length = 0;
@ -379,7 +380,7 @@ ProcXListInputDevices(ClientPtr client)
}
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;

View file

@ -126,6 +126,7 @@ ProcXOpenDevice(ClientPtr client)
if (status != Success)
return status;
memset(&rep, 0, sizeof(xOpenDeviceReply));
rep.repType = X_Reply;
rep.RepType = X_OpenDevice;
rep.sequenceNumber = client->sequence;