diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-24 14:14:48 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-24 15:40:36 +1000 |
commit | 801d77d035a10250dab728c046a6e9b2775e6dfb (patch) | |
tree | f7785ca25be6f64c26c207193141bda19fb8bbb7 | |
parent | bff36ef5797d7da11972ee22ea224e207af77455 (diff) |
XQueryDeviceState: correct length of XValuatorState
The length is suppposed to be the complete class size, not just the struct
size. Since XValuatorState is followed by multiple valuator values the
size of the class is variable and dependent on the number of valuators.
The server assembles the valuator state last. This bug is unlikely to affect
clients as they should never go past the last class anyway.
Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/XQueryDv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/XQueryDv.c b/src/XQueryDv.c index 5996734..d9495c2 100644 --- a/src/XQueryDv.c +++ b/src/XQueryDv.c @@ -160,7 +160,8 @@ XQueryDeviceState( CARD32 *valuators = (CARD32 *) (v + 1); V->class = v->class; - V->length = sizeof(XValuatorState); + V->length = sizeof(XValuatorState) + + v->num_valuators * sizeof(int); V->num_valuators = v->num_valuators; V->mode = v->mode; Any = (XInputClass *) (V + 1); |