mirror of
https://github.com/solemnwarning/ipxwrapper
synced 2024-12-30 16:45:37 +01:00
Fixed segfault in recvfrom when called with NULL addrlen.
This commit is contained in:
parent
34ae708491
commit
018c66873f
@ -5,6 +5,8 @@ Version XXX:
|
||||
protocol value correctly.
|
||||
|
||||
Bugfix: Removed conflicting send and connect functions.
|
||||
|
||||
Bugfix: Fixed segfault in recvfrom when called with NULL addrlen.
|
||||
|
||||
Version 0.4.1:
|
||||
Feature: Added workaround for point-to-point links.
|
||||
|
@ -625,7 +625,7 @@ int WSAAPI recvfrom(SOCKET fd, char *buf, int len, int flags, struct sockaddr *a
|
||||
|
||||
int extended_addr = sock->flags & IPX_EXT_ADDR;
|
||||
|
||||
int rval = recv_packet(sock, buf, len, flags, (struct sockaddr_ipx_ext*)addr, *addrlen);
|
||||
int rval = recv_packet(sock, buf, len, flags, (struct sockaddr_ipx_ext*)(addr), (addrlen ? *addrlen : 0));
|
||||
|
||||
/* The value pointed to by addrlen is only set if the
|
||||
* recv call was successful, may not be correct.
|
||||
@ -703,6 +703,9 @@ int PASCAL WSARecvEx(SOCKET fd, char *buf, int len, int *flags)
|
||||
*
|
||||
* I _THINK_ it should return the amount of data
|
||||
* actually copied to the buffer.
|
||||
*
|
||||
* Windows 95/98: Returns -1
|
||||
* Windows 2000/XP: Returns len
|
||||
*/
|
||||
|
||||
rval = len;
|
||||
@ -752,6 +755,14 @@ int WSAAPI getsockopt(SOCKET fd, int level, int optname, char FAR *optval, int F
|
||||
{
|
||||
if(optname == IPX_PTYPE)
|
||||
{
|
||||
/* NOTE: Windows 95/98 only write to the first
|
||||
* byte of the buffer, leaving the rest
|
||||
* uninitialised. Windows 2000/XP write all 4
|
||||
* bytes.
|
||||
*
|
||||
* Both require optlen to be at least 4.
|
||||
*/
|
||||
|
||||
RETURN_INT_OPT(sock->s_ptype);
|
||||
}
|
||||
else if(optname == IPX_FILTERPTYPE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user