diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-27 10:22:44 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-27 13:15:28 +1030 |
commit | edebe76cfdb31072d18a6fcd3ee8f1d95006855f (patch) | |
tree | 7e34d80c7d0333a523f0787458baba2970516df3 | |
parent | 601307615e4955be23fd86a057285074242ad83e (diff) |
Xi: set DeviceXXXState's length fields to the correct size of the struct.
Setting it to the size of a pointer is an interesting but equally wrong
approach. Luckily Xlib never used this field anyway so nobody got hurt so far.
Spotted by Simon Thum.
(cherry picked from commit 0f2398d06ce591724e388b3270800c5e22b3de2d)
-rw-r--r-- | Xi/getdctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 8a84e91bc..7175dc253 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -128,7 +128,7 @@ static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts, xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf; calib->control = DEVICE_ABS_CALIB; - calib->length = sizeof(calib); + calib->length = sizeof(xDeviceAbsCalibState); calib->min_x = dts->min_x; calib->max_x = dts->max_x; calib->min_y = dts->min_y; @@ -159,7 +159,7 @@ static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts, xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf; area->control = DEVICE_ABS_AREA; - area->length = sizeof(area); + area->length = sizeof(xDeviceAbsAreaState); area->offset_x = dts->offset_x; area->offset_y = dts->offset_y; area->width = dts->width; @@ -185,7 +185,7 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf) xDeviceCoreState *c = (xDeviceCoreState *) buf; c->control = DEVICE_CORE; - c->length = sizeof(c); + c->length = sizeof(xDeviceCoreState); c->status = dev->coreEvents; c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer); @@ -202,7 +202,7 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf) xDeviceEnableState *e = (xDeviceEnableState *) buf; e->control = DEVICE_ENABLE; - e->length = sizeof(e); + e->length = sizeof(xDeviceEnableState); e->enable = dev->enabled; if (client->swapped) { |