mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2025-12-28 18:00:08 +01:00
imDefLkup: verify that a pointer isn't NULL before using it
It is possible for _XimICOfXICID() to return NULL, so it is necessary to check this isn't actually the case before dereferencing the pointer. All other callers of _XimICOfXICID() do this check too. (The check itself is ugly, but it follows the style of the code in the rest of the module.) Fixes issue #45. Reported-by: Bhavi Dhingra Original-patch-by: Bhavi Dhingra Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
This commit is contained in:
parent
b83938f7f9
commit
623b77d4f3
1 changed files with 2 additions and 1 deletions
|
|
@ -88,7 +88,8 @@ _XimSetEventMaskCallback(
|
|||
|
||||
if (imid == im->private.proto.imid) {
|
||||
if (icid) {
|
||||
ic = _XimICOfXICID(im, icid);
|
||||
if (!(ic = _XimICOfXICID(im, icid)))
|
||||
return False;
|
||||
_XimProcICSetEventMask(ic, (XPointer)&buf_s[2]);
|
||||
} else {
|
||||
_XimProcIMSetEventMask(im, (XPointer)&buf_s[2]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue