Skip to content

XGetFeedbackControl: skip over unknown feedback controls

Peter Hutterer requested to merge whot/libxi:wip/feedback-invalid-length into master

If the server sends an unknown feedback control class we would allocate the amount of protocol bytes for the client representation but then later mess up the actual composition of the classes due to Feedback->length never being initialized.

So while in theory it looks like this:

   |-------------- allocated size -----------------|
   [led feedback] [ ?unknown? ] [kbd feedback][....]

with unknown being the size of the class on the protocol, in practice it looks like this:

   |-------------- allocated size -----------------|
   [led feedback] [ ?unknown?                ] [kbd feedback][...]

with unknown being the size of whatever was in the Feeback->length pointed to at the time. The content of unknown is never initialized.

Fix this by making unknown classes disappear so the above becomes:

   |------- allocated size ---------|
   [led feedback][kbd feedback][....]

Closes #16 (closed)

cc @alanc - not sure how to test this though...

Merge request reports

Loading