Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • libxcb libxcb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 39
    • Issues 39
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

Update #1:

Due to abusive users subverting our CI facilities to mine cryptocurrency, breaking out of the container sandbox in the process, we have been forced to take actions to limit the usage of the public runners to official projects only.

The policy will be enforced on 2023-03-23 (or before if we detect abuses).

Please see this issue for more context and to see if and how you are impacted.

  • xorgxorg
  • lib
  • libxcblibxcb
  • Merge requests
  • !20

Fix forwards-compatibility bug by allowing to specify expression that defines length of a struct

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Povilas Kanapickas requested to merge p12tic/libxcb:xinput-deviceclass-length into master Aug 12, 2021
  • Overview 10
  • Commits 4
  • Pipelines 0
  • Changes 1

This MR fixes a forwards-compatibility bug that causes X server clients to crash when new XInput 2.4 GestureClass structs are sent within a response to XIQueryDevice request. X server has been patched in xorg/xserver@eb6f8dac to not send these new structs unless the client advertises XInput 2.4 support, but we still need to fix this issue as larger programs may have multiple versions of embedded libxcb.

The xcbproto part of this fix is here: xorg/proto/xcbproto!23 (merged)

This PR adjusts c_client.py to handle the new <length> element.

Regenerating the libxcb sources on top of xorg/proto/xcbproto!23 (merged) produces the following diff as expected (no other files were affected):

diff --git a/xinput.c b/xinput.c
index 9c3648f..086f0dc 100644
--- a/xinput.c
+++ b/xinput.c
@@ -10535,32 +10535,8 @@ xcb_input_device_class_data_sizeof (const void  *_buffer,
 int
 xcb_input_device_class_sizeof (const void  *_buffer)
 {
-    char *xcb_tmp = (char *)_buffer;
     const xcb_input_device_class_t *_aux = (xcb_input_device_class_t *)_buffer;
-    unsigned int xcb_buffer_len = 0;
-    unsigned int xcb_block_len = 0;
-    unsigned int xcb_pad = 0;
-    unsigned int xcb_align_to = 0;
-
-
-    xcb_block_len += sizeof(xcb_input_device_class_t);
-    xcb_tmp += xcb_block_len;
-    xcb_buffer_len += xcb_block_len;
-    xcb_block_len = 0;
-    /* data */
-    xcb_block_len += xcb_input_device_class_data_sizeof(xcb_tmp, _aux->type);
-    xcb_tmp += xcb_block_len;
-    xcb_align_to = ALIGNOF(char);
-    /* insert padding */
-    xcb_pad = -xcb_block_len & (xcb_align_to - 1);
-    xcb_buffer_len += xcb_block_len + xcb_pad;
-    if (0 != xcb_pad) {
-        xcb_tmp += xcb_pad;
-        xcb_pad = 0;
-    }
-    xcb_block_len = 0;
-
-    return xcb_buffer_len;
+    return (_aux->len * 4);
 }

cc @alanc

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: xinput-deviceclass-length