[Bug 1755] New: _XGetAsyncReply mishandling of 'discard' parameter

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 1 09:19:14 PST 2004


Please do not reply to this email: if you want to comment on the bug, go to          
the URL shown below and enter yourcomments there.   
 
https://freedesktop.org/bugzilla/show_bug.cgi?id=1755        
   
           Summary: _XGetAsyncReply mishandling of 'discard' parameter
           Product: xorg
           Version: CVS_head
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Lib/Xlib
        AssignedTo: xorg-bugzilla-noise at freedesktop.org
        ReportedBy: otaylor at redhat.com
                CC: hp at redhat.com,keithp at keithp.com


_XGetAsyncReply has:

        if (discard && (rep->generic.length << 2) > len)
            _XEatData (dpy, (rep->generic.length << 2) - len);

(And two cases similar further down that also needs fixing; the
second usage of discard and the error case)

The problem here is that 'len' is the value passed to the calling
handler - the number of bytes that has already been read off the buffer.
But in the X protocol, rep->generic.length is the number of words
*after* the 32 byte standard sizeof(xReply).

Havoc - I'm wondering if this is:

       * Passing discard = True seems to break things; I don't understand
       * why, because there should be no extra data in an error reply,
       * right?

in metacity/async-getprop.c. Though I don't understand the connection, since 
reply->generic.length should be 0 for xError always (making the call
to _XGetAsyncReply() a bit unecessary), and also meaning that 
(rep->generic.length << 2) > len will be FALSE.        
   
   
--         
Configure bugmail: https://freedesktop.org/bugzilla/userprefs.cgi?tab=email       
   
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the xorg-bugzilla-noise mailing list