]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't crash when calling IPv4LL without an address in state
authorRoy Marples <roy@marples.name>
Fri, 10 Mar 2017 14:44:26 +0000 (14:44 +0000)
committerRoy Marples <roy@marples.name>
Fri, 10 Mar 2017 14:44:26 +0000 (14:44 +0000)
ipv4ll.c

index fd37ac8d075cd6ca341330159831bab8da2dfd0a..0877ce731380988f5d98c172d356bea8df687d7d 100644 (file)
--- a/ipv4ll.c
+++ b/ipv4ll.c
@@ -144,7 +144,7 @@ ipv4ll_env(char **env, const char *prefix, const struct interface *ifp)
        struct in_addr netnum;
 
        assert(ifp != NULL);
-       if ((state = IPV4LL_CSTATE(ifp)) == NULL)
+       if ((state = IPV4LL_CSTATE(ifp)) == NULL || state->addr == NULL)
                return 0;
 
        if (env == NULL)