Kiyoshi Hayakawa / lwip_t

Fork of lwip by mbed official

Revision:
14:6f5eba4163ea
Parent:
0:51ac1d130fd4
--- a/core/netif.c	Sat Sep 28 15:58:36 2013 +0000
+++ b/core/netif.c	Sat Sep 28 16:11:28 2013 +0000
@@ -318,6 +318,12 @@
 void
 netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)
 {
+  /* Protect against dereferencing NULL pointers by
+     treating like ANY, as does ip_addr_set() */
+  if (!ipaddr) {
+    ipaddr = IP_ADDR_ANY;
+  }
+  
   /* TODO: Handling of obsolete pcbs */
   /* See:  http://mail.gnu.org/archive/html/lwip-users/2003-03/msg00118.html */
 #if LWIP_TCP