[Xcb] strings in xcb requests

Eamon Walsh ewalsh at tycho.nsa.gov
Tue Jun 17 11:23:03 PDT 2008

Ian Osgood wrote:
> On Jun 17, 2008, at 5:08 AM, Ted X Toth wrote:
>> I'm using the xcb-xselinux extension and getting a BadLength error  
>> from
>> xcb_set_selection_use_context. I'd like to know how strings are  
>> handled
>> specifically is a null terminator sent to the server? This request
>> includes the length of the string so it shouldn't need the terminator
>> but if it doesn't send it the server would need to add it, right?
>> _______________________________________________
> No, X requests always use counted strings that don't need to be null  
> terminated, and the XCB calls stay very close to the protocol. (No  
> jokes about X being older than C, please.)

Unfortunately, I wrote the SELinux extension so that it does expect a 
NULL terminator, and returns BadLength if it doesn't see one.  This can 
be fixed in a backwards compatible way (since it doesn't matter from a 
string point of view how many NULLs there are), but I haven't gotten 
around to doing yet.

Eamon Walsh <ewalsh at tycho.nsa.gov>
National Security Agency

More information about the Xcb mailing list