Commit 48bc30c5 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Peter Hutterer
Browse files

Xext: avoid null-pointer dereference in XTestFakeInput (#59937)

dv is still NULL at this point, so return firstValuator instead (which is
the same value dv->firstValuator would be once initialized)

X.Org Bug 59937 <http://bugs.freedesktop.org/show_bug.cgi?id=59937

>
Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 1058fcf5
......@@ -156,7 +156,6 @@ ProcXTestFakeInput(ClientPtr client)
DeviceIntPtr dev = NULL;
WindowPtr root;
Bool extension = FALSE;
deviceValuator *dv = NULL;
ValuatorMask mask;
int valuators[MAX_VALUATORS] = { 0 };
int numValuators = 0;
......@@ -241,14 +240,14 @@ ProcXTestFakeInput(ClientPtr client)
}
if (nev > 1 && !dev->valuator) {
client->errorValue = dv->first_valuator;
client->errorValue = firstValuator;
return BadValue;
}
/* check validity of valuator events */
base = firstValuator;
for (n = 1; n < nev; n++) {
dv = (deviceValuator *) (ev + n);
deviceValuator *dv = (deviceValuator *) (ev + n);
if (dv->type != DeviceValuator) {
client->errorValue = dv->type;
return BadValue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment