diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-06-07 09:54:25 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-06-07 11:39:08 +0200 |
commit | 0849051df28f8d2f688cdd6aad732d322937b7c6 (patch) | |
tree | c43704ee847b7298e5d38055346fdf9e7e82453d /src/dhcp.c | |
parent | a2d77c59177c5951b254952d73eb3779f8357b81 (diff) | |
download | connman-0849051df28f8d2f688cdd6aad732d322937b7c6.tar.gz connman-0849051df28f8d2f688cdd6aad732d322937b7c6.tar.bz2 connman-0849051df28f8d2f688cdd6aad732d322937b7c6.zip |
dhcp: Fix dhcp_invalidate NULL pointer access
dhcp->nameservers can be NULL. This can be triggered with toggling
the technologies switches fast enough.
Diffstat (limited to 'src/dhcp.c')
-rw-r--r-- | src/dhcp.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -96,9 +96,11 @@ static void dhcp_invalidate(struct connman_dhcp *dhcp, connman_bool_t callback) __connman_service_set_pac(service, NULL); __connman_service_timeserver_remove(service, dhcp->timeserver); - for (i = 0; dhcp->nameservers[i] != NULL; i++) { - __connman_service_nameserver_remove(service, - dhcp->nameservers[i]); + if (dhcp->nameservers != NULL) { + for (i = 0; dhcp->nameservers[i] != NULL; i++) { + __connman_service_nameserver_remove(service, + dhcp->nameservers[i]); + } } __connman_ipconfig_address_remove(ipconfig); |