From 4c00d515f128eb314ef2ebf682c239df99b5125b Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 20 Aug 2018 21:06:24 -0400 Subject: [PATCH] freebsd11_network: Add NULL check to if_getdrvflags. This is the proper fix for #14182, as discussed on the mailing list. --- src/libs/compat/freebsd11_network/if.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/compat/freebsd11_network/if.c b/src/libs/compat/freebsd11_network/if.c index 3a23dbcf53..1f0e38c3da 100644 --- a/src/libs/compat/freebsd11_network/if.c +++ b/src/libs/compat/freebsd11_network/if.c @@ -1052,6 +1052,8 @@ if_setdrvflagbits(if_t ifp, int set_flags, int clear_flags) int if_getdrvflags(if_t ifp) { + if ((struct ifnet *)ifp == NULL) + return 0; return ((struct ifnet *)ifp)->if_drv_flags; }