dix: reset MD's devPrivate classes to NULL before device initialisation.
XkbInitKeyboardDefviceStruct may call FatalError if it fails. FatalError then cleans up all the devices, resulting in a segfault if the pointer is uninitialised.
This commit is contained in:
parent
be3321c2e9
commit
12dd6e9911
|
@ -396,6 +396,8 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
|
|||
if (!AllocateDevicePrivate(pDev, MasterDevClassesPrivIdx) ||
|
||||
!(classes = xcalloc(1, sizeof(ClassesRec))))
|
||||
|
||||
pDev->devPrivates[MasterDevClassesPrivIdx].ptr = NULL;
|
||||
|
||||
keySyms.minKeyCode = 8;
|
||||
keySyms.maxKeyCode = 255;
|
||||
keySyms.mapWidth = 4;
|
||||
|
@ -495,6 +497,8 @@ CorePointerProc(DeviceIntPtr pDev, int what)
|
|||
!(classes = xcalloc(1, sizeof(ClassesRec))))
|
||||
return BadAlloc;
|
||||
|
||||
pDev->devPrivates[MasterDevClassesPrivIdx].ptr = NULL;
|
||||
|
||||
for (i = 1; i <= 32; i++)
|
||||
map[i] = i;
|
||||
InitPointerDeviceStruct((DevicePtr)pDev, map, 32,
|
||||
|
|
Loading…
Reference in New Issue
Block a user