[Xcb] [Bug 34037] New: xcb_str_next uses padding when there isn't any

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Feb 8 07:03:28 PST 2011


           Summary: xcb_str_next uses padding when there isn't any
           Product: XCB
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Library
        AssignedTo: xcb at lists.freedesktop.org
        ReportedBy: erkki.seppala at vincit.fi
         QAContact: xcb at lists.freedesktop.org

Created an attachment (id=43105)
 --> (https://bugs.freedesktop.org/attachment.cgi?id=43105)
A short utility to list the extensions of the X server

xcb_str_next iterates through lists of strings, which are of format <string
length><string contents><string length><string contents> etc. However, this
list does not have padding. 

c_client.py generates a function xcb_str_sizeof, which calculates the length of
one of those strings, but at least in the context of strings the additional
padding isn't there. This is the function used by the new xcb_str_next to
determine the next offset to jump into.

Attached is a program to list X extensions of the server. It fails unless the
accompanied fixed_xcb_str_next is used.

The issue is between XCB 1.7 and the GIT HEAD. I suspect the issue may be
related to change 77b594f9583ea0247ff27130316d8e045da7f921 (because it
generates the _sizeof functions), but that cannot be easily reverted by itself.
In any case I found that that problem-inducing commit is between the good
8c2707773b3621fb8bbda9021d23944f5be34aab and the bad commit
22e1013131984a217e9bddeac3a6a4183e35f0c1; I had trouble compiling the versions

Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the Xcb mailing list