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@winehq.org ReportedBy: admin@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;