aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2018-06-24 23:33:33 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-11-09 15:31:57 +0100
commit2db519141865cd504351aabf042db5bdf2ac5d96 (patch)
tree9214e7f9f46c637e99bdda6e667a7e4447821f90 /nx-X11/programs
parent122db3fde2b934df206567abc0c8b431962ce4b3 (diff)
downloadnx-libs-2db519141865cd504351aabf042db5bdf2ac5d96.tar.gz
nx-libs-2db519141865cd504351aabf042db5bdf2ac5d96.tar.bz2
nx-libs-2db519141865cd504351aabf042db5bdf2ac5d96.zip
Check nxagentXkbInfo.EventBase before use
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index 94480c45c..4c85145a9 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -2782,7 +2782,8 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X)
{
XkbEvent *xkbev = (XkbEvent *) X;
- if (xkbev -> type == nxagentXkbInfo.EventBase + XkbEventCode &&
+ if (nxagentXkbInfo.EventBase != -1 &&
+ xkbev -> type == nxagentXkbInfo.EventBase + XkbEventCode &&
xkbev -> any.xkb_type == XkbStateNotify)
{
#ifdef TEST
@@ -3815,6 +3816,11 @@ int nxagentInitXkbKeyboardState(void)
XkbEvent *xkbev = (XkbEvent *) &X;
+ if (nxagentXkbInfo.EventBase == -1)
+ {
+ return 1;
+ }
+
#ifdef TEST
fprintf(stderr, "%s: Initializing XKB state.\n", __func__);
#endif