[Bug 29164] New: Swap buffers in GetAcceptExSockaddrs (WS2_async_accept).

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Nov 25 11:06:34 CST 2011


http://bugs.winehq.org/show_bug.cgi?id=29164

             Bug #: 29164
           Summary: Swap buffers in GetAcceptExSockaddrs
                    (WS2_async_accept).
           Product: Wine
           Version: 1.3.33
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P2
         Component: winsock
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: admin at myac.msk.ru
    Classification: Unclassified


Bug occurs since version 1.3.12.

The functions of WS2_async_accept used the wrong procedure for filling the
buffer. Should be reversed and local_addr remote_addr!!!

Should be as follows:

    /* WS2 Spec says size param is extra 16 bytes long...what do we put in it?
*/ 
    addr = ((char *)wsa->buf) + wsa->data_len; 
    len = wsa->local_len - sizeof(int);   
 -  WS_getpeername(HANDLE2SOCKET(wsa->accept_socket), 
 +  WS_getsockname(HANDLE2SOCKET(wsa->accept_socket), 
                   (struct WS_sockaddr *)(addr + sizeof(int)), &len); 
    *(int *)addr = len; 

    addr += wsa->local_len; 
    len = wsa->remote_len - sizeof(int); 
 -  WS_getsockname(HANDLE2SOCKET(wsa->accept_socket), 
 +  WS_getpeername(HANDLE2SOCKET(wsa->accept_socket), 
                   (struct WS_sockaddr *)(addr + sizeof(int)), &len); 
    *(int *)addr = len;

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list