Xi: exevents: NULL protection in ‘DeviceEventSuppressForWindow()
Protect against `inputMasks` could be NULL. | ../Xi/exevents.c: In function ‘DeviceEventSuppressForWindow’: | ../Xi/exevents.c:3246:32: warning: dereference of NULL ‘inputMasks’ [CWE-476] [-Wanalyzer-null-dereference] | 3246 | FreeResource(inputMasks->inputClients->resource, X11_RESTYPE_NONE); | | ~~~~~~~~~~^~~~~~~~~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
f022f1c764
commit
d91121e876
|
@ -3241,8 +3241,11 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
|
||||||
inputMasks->dontPropagateMask[maskndx] = mask;
|
inputMasks->dontPropagateMask[maskndx] = mask;
|
||||||
}
|
}
|
||||||
RecalculateDeviceDeliverableEvents(pWin);
|
RecalculateDeviceDeliverableEvents(pWin);
|
||||||
if (ShouldFreeInputMasks(pWin, FALSE))
|
if (ShouldFreeInputMasks(pWin, FALSE)) {
|
||||||
|
BUG_RETURN_VAL(!inputMasks, BadImplementation);
|
||||||
|
BUG_RETURN_VAL(!inputMasks->inputClients, BadImplementation);
|
||||||
FreeResource(inputMasks->inputClients->resource, X11_RESTYPE_NONE);
|
FreeResource(inputMasks->inputClients->resource, X11_RESTYPE_NONE);
|
||||||
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue