mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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:
@@ -3241,8 +3241,11 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
|
||||
inputMasks->dontPropagateMask[maskndx] = mask;
|
||||
}
|
||||
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);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user