From: Steven Barth Date: Fri, 17 Jan 2014 13:04:36 +0000 (+0100) Subject: Fix a segfault in state-script handling X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0a41d480c058b68fe09ac7de044c561dee955233;p=oweals%2Fodhcpd.git Fix a segfault in state-script handling --- diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index 2e93bd0..88840a4 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -211,7 +211,7 @@ void dhcpv6_write_statefile(void) if (iface->dhcpv6 != RELAYD_SERVER && iface->dhcpv4 != RELAYD_SERVER) continue; - if (iface->dhcpv6 == RELAYD_SERVER) { + if (iface->dhcpv6 == RELAYD_SERVER && iface->ia_assignments.next) { struct dhcpv6_assignment *c; list_for_each_entry(c, &iface->ia_assignments, head) { if (c->clid_len == 0) @@ -262,7 +262,7 @@ void dhcpv6_write_statefile(void) } } - if (iface->dhcpv4 == RELAYD_SERVER) { + if (iface->dhcpv4 == RELAYD_SERVER && iface->dhcpv4_assignments.next) { struct dhcpv4_assignment *c; list_for_each_entry(c, &iface->dhcpv4_assignments, head) { char ipbuf[INET6_ADDRSTRLEN];