mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-27 21:22:26 +00:00
xserver: Avoid sending uninitialized padding data over the network
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
b735a4b495
commit
ddb8d8945d
24 changed files with 86 additions and 16 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue