Skip to content

Don't dereference NULL ipaddr in netif_set_ipaddr() #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libraries/net/lwip/lwip/core/netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ netif_find(char *name)
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
Expand Down