Fixed bug #34733 Null pointer exception with SOCKET_DEBUG.

This commit is contained in:
goldsimon 2011-11-13 17:06:19 +01:00
parent 7aa7c0f481
commit d12e742373

View File

@ -758,10 +758,15 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags,
ipX_addr_debug_print(NETCONNTYPE_ISIPV6(netconn_type(sock->conn)), ipX_addr_debug_print(NETCONNTYPE_ISIPV6(netconn_type(sock->conn)),
SOCKETS_DEBUG, fromaddr); SOCKETS_DEBUG, fromaddr);
LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%d\n", port, off)); LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%d\n", port, off));
if (*fromlen > saddr.sa.sa_len) { #if SOCKETS_DEBUG
*fromlen = saddr.sa.sa_len; if (from && fromlen)
#endif /* SOCKETS_DEBUG */
{
if (*fromlen > saddr.sa.sa_len) {
*fromlen = saddr.sa.sa_len;
}
MEMCPY(from, &saddr, *fromlen);
} }
MEMCPY(from, &saddr, *fromlen);
} }
} }