* fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen

pointer to NULL if name pointer is NULL.  Explain why.
This commit is contained in:
Corinna Vinschen 2009-06-13 16:13:01 +00:00
parent 2476ec9bdf
commit 792c564b27
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2009-06-13 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen
pointer to NULL if name pointer is NULL. Explain why.
2009-06-12 Corinna Vinschen <corinna@vinschen.de>
* localtime.cc (time2): Change "spring gap" to "spring forward gap"

View file

@ -1347,7 +1347,12 @@ fhandler_socket::recv_internal (LPWSAMSG wsamsg)
res = WSARecvMsg (get_socket (), wsamsg, &wret, NULL, NULL);
else
res = WSARecvFrom (get_socket (), wsabuf, wsacnt, &wret,
&wsamsg->dwFlags, wsamsg->name, &wsamsg->namelen,
&wsamsg->dwFlags, wsamsg->name,
/* Winsock returns WSAEFAULT if namelen is a valid
pointer while name is NULL. Both parameters are
ignored for TCP sockets, so this only occurs when
using UDP socket. */
wsamsg->name ? &wsamsg->namelen : NULL,
NULL, NULL);
if (!res)
{