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,12 +758,17 @@ 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 SOCKETS_DEBUG
if (from && fromlen)
#endif /* SOCKETS_DEBUG */
{
if (*fromlen > saddr.sa.sa_len) { if (*fromlen > saddr.sa.sa_len) {
*fromlen = saddr.sa.sa_len; *fromlen = saddr.sa.sa_len;
} }
MEMCPY(from, &saddr, *fromlen); MEMCPY(from, &saddr, *fromlen);
} }
} }
}
/* If we don't peek the incoming message... */ /* If we don't peek the incoming message... */
if ((flags & MSG_PEEK) == 0) { if ((flags & MSG_PEEK) == 0) {