From 0e7703f9b1927328954a2fc87aac6be244819329 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 13 Apr 2010 22:28:36 +0200 Subject: [PATCH] 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 Reported-by: "Bernhard R. Link" Signed-off-by: Julien Cristau Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- hw/vfb/InitInput.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 35d1dc4d2..10bb6a599 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -43,6 +43,7 @@ from The Open Group. #include #include "xserver-properties.h" #include "exevents.h" +#include "extinit.h" Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) @@ -136,10 +137,15 @@ 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(); }