]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add an assert to fix an impossible clang analyzer condition
authorRoy Marples <roy@marples.name>
Sat, 16 May 2015 21:39:56 +0000 (21:39 +0000)
committerRoy Marples <roy@marples.name>
Sat, 16 May 2015 21:39:56 +0000 (21:39 +0000)
ipv4.c

diff --git a/ipv4.c b/ipv4.c
index e5e3a6023d92cba4747657e29d5e6cc0634a9351..3c872a36a57529fa345c36f8100a4f6775cd2b2d 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -32,6 +32,7 @@
 #include <arpa/inet.h>
 #include <net/route.h>
 
+#include <assert.h>
 #include <ctype.h>
 #include <errno.h>
 #include <stdlib.h>
@@ -885,6 +886,8 @@ ipv4_finalisert(struct interface *ifp)
 {
        const struct dhcp_state *state = D_CSTATE(ifp);
 
+       assert(state != NULL);
+
        /* Find any freshly added routes, such as the subnet route.
         * We do this because we cannot rely on recieving the kernel
         * notification right now via our link socket. */