Skip to content

Commit

Permalink
WiFiUDP: fix crash when calling destinationIP with no packet available
Browse files Browse the repository at this point in the history
Fixes #3989.
  • Loading branch information
igrr committed Dec 27, 2017
1 parent db1cfc7 commit f77a6c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libraries/ESP8266WiFi/src/include/UdpContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ class UdpContext

uint32_t getDestAddress()
{
if (!_rx_buf)
return 0;

ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
return iphdr->dest.addr;
}
Expand Down

0 comments on commit f77a6c2

Please sign in to comment.