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

Uli Schlachter psychon at znc.in
Wed Aug 24 03:57:00 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 08.02.2011 16:03, bugzilla-daemon at freedesktop.org wrote:
> https://bugs.freedesktop.org/show_bug.cgi?id=34037
> 
>            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
> commit 
> 8c2707773b3621fb8bbda9021d23944f5be34aab and the bad commit
> 22e1013131984a217e9bddeac3a6a4183e35f0c1; I had trouble compiling the versions
> in-between.

Hi list,

I took a quick look at this issue. The result is the attached commit. Hopefully
the commit message explains it all.

I'd like to highlight again that I'm really not sure if this patch is correct,
it's just the first hack that I tried. Also, I have no clue about python.

Cheers,
Uli

- -- 
- - He made himself, me nothing, you nothing out of the dust
- - Er machte sich mir nichts, dir nichts aus dem Staub
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBCAAGBQJOVNj5AAoJECLkKOvLj8sGNCkIAJdr01kQ8HVUaNCtztOt34Iw
69WISwhQnec3hNLX0l5I8xMtkdkIsspG/hz2dQFB2yUPMKld0NUCMZtD6NqzU8KE
wGUxf3v77UeBRwKTme2ttpbsEzu93f4zjTQzCq3UzFETFNo9nX98N419vNqceDv7
MQQqZxe25++fzU/t9yX6fBg/hTDwO+Zq0e/fyE5cveAAlYCXUix/4hIPZoSC1W6n
ialBjJB8pGxag4dwPgf4vbPZtaTDrTJhEb34o1jGQNWVAy1JQEGGaGRHxx1obmEp
UruIdktx/pBtYfbZnxTNZ+vR8YFtedewITHEoUJZyqf60fMVKwxBiVOpSJbdO8g=
=BZON
-----END PGP SIGNATURE-----


More information about the Xcb mailing list