possible bug

Simon Thum simon.thum at gmx.de
Mon Dec 17 06:56:45 PST 2007


Hi Peter,

I think I've found a followup:
Again in getdctl.c, l. 300:
    case DEVICE_CORE:
        total_length = sizeof(xDeviceCoreCtl);

Shouldn't that, if only for consitency, refer to xDevice*State? I don't
think those stuctures are actually diffently sized, but they differ for
sure.

>> I'm currently trying to extend the X*DeviceControl mechanism found in
>> Xinput.h, and I think I have found a bug.
>>
>> E.g. in getdctl.c, l. 134: (not the only occassion)
>>
>>     xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf;
>>     [...]
>>     calib->length = sizeof(calib);
>>
>> AFAIK, sizeof(pointer) is 4 or 8 for most archs, which is too low in
>> some if not all cases. This length is pretty much ignored on the server
>> side, so we have no problems here. But if I haven't missed a thing, that
>> wrong lenght still makes it to the client, asking for trouble there.
> 
> thanks. yes, that was a bug. fixed and pushed.
> 
> same bug was btw also in the libXi decoding of the same request. fixed too.
> 
> thanks again.
> 
> Cheers,
>   Peter
> 




More information about the xorg mailing list