diff options
author | Julien Cristau <jcristau@debian.org> | 2010-04-13 22:28:36 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-04-16 08:12:37 +1000 |
commit | c52b9e143da294e787d93ddbd7b9b620a3a892e2 (patch) | |
tree | 8142343539951904e25220448b443e4192e02f74 | |
parent | 9a9a19ac4ecdab0e2602d70354145545de37f3c5 (diff) |
vfb: add a name and type to the pointer and keyboard
Fixes a crash in XIQueryDevice which calls strlen on a NULL pointer.
#0 strlen () at ../sysdeps/x86_64/strlen.S:31
#1 0x00000000004c16ed in SizeDeviceInfo (dev=0x969bd0)
at ../../Xi/xiquerydevice.c:204
#2 0x00000000004c1a01 in ProcXIQueryDevice (client=0xa57510)
at ../../Xi/xiquerydevice.c:98
Debian bug#575905 <http://bugs.debian.org/575905>
Reported-by: "Bernhard R. Link" <brlink@debian.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0e7703f9b1927328954a2fc87aac6be244819329)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | hw/vfb/InitInput.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 7f2d56fa8..b79504767 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -43,6 +43,7 @@ from The Open Group. #include <X11/keysym.h> #include "xserver-properties.h" #include "exevents.h" +#include "extinit.h" Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) @@ -136,9 +137,14 @@ void InitInput(int argc, char *argv[]) { DeviceIntPtr p, k; + Atom xiclass; p = AddInputDevice(serverClient, vfbMouseProc, TRUE); k = AddInputDevice(serverClient, vfbKeybdProc, TRUE); RegisterPointerDevice(p); + xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE); + AssignTypeAndName(p, xiclass, "Xvfb mouse"); RegisterKeyboardDevice(k); + xiclass = MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE); + AssignTypeAndName(k, xiclass, "Xvfb keyboard"); (void)mieqInit(); } |