mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
dix: calloc, not malloc, ValuatorClassRec.
For master devices, the ptraccel code could segfault on free since we'd be dereferencing random memory. Callocing the valuatorClassRec is the easy fix.
This commit is contained in:
@@ -1235,7 +1235,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes,
|
||||
if (!dev)
|
||||
return FALSE;
|
||||
|
||||
valc = (ValuatorClassPtr)xalloc(sizeof(ValuatorClassRec) +
|
||||
valc = (ValuatorClassPtr)xcalloc(1, sizeof(ValuatorClassRec) +
|
||||
numAxes * sizeof(AxisInfo) +
|
||||
numAxes * sizeof(unsigned int));
|
||||
if (!valc)
|
||||
|
||||
Reference in New Issue
Block a user