summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-25 15:39:36 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-25 15:50:19 -0700
commit08431d0684f9a1edf199f6c6060d2bef1ac78399 (patch)
tree3646596499e2656b8b600bb1c57609fe1c3f6162 /src
parentbca3474a8622fde5815260461784282f78a4efb5 (diff)
XInput_find_display: Don't dereference NULL dpyinfo
Unlikely, but could happen if calloc fails in XextAddDisplay() Relies on XextHasExtension(i) macro from <X11/extensions/extutil.h> which checks for ((i) && ((i)->codes)) Fixes: #15 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src')
-rw-r--r--src/XExtInt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 2e2a510..06474b2 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -230,7 +230,7 @@ XExtDisplayInfo *XInput_find_display (Display *dpy)
xinput_extension_name,
&xinput_extension_hooks,
nevents, NULL);
- if (dpyinfo->codes) /* NULL if XI doesn't exist on the server */
+ if (XextHasExtension(dpyinfo)) /* skip if XI doesn't exist on the server */
{
XESetWireToEventCookie(dpy, dpyinfo->codes->major_opcode, XInputWireToCookie);
XESetCopyEventCookie(dpy, dpyinfo->codes->major_opcode, XInputCopyCookie);