Skip to content

Commit 7fc23c6

Browse files
igrrdevyte
authored andcommitted
WiFiUDP: fix crash when calling destinationIP with no packet available (#4036)
Fixes #3989.
1 parent db1cfc7 commit 7fc23c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/ESP8266WiFi/src/include/UdpContext.h

+3
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ class UdpContext
163163

164164
uint32_t getDestAddress()
165165
{
166+
if (!_rx_buf)
167+
return 0;
168+
166169
ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
167170
return iphdr->dest.addr;
168171
}

0 commit comments

Comments
 (0)