From f5b0690d48b94e07abc90ee4f1e44565f941df53 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Mon, 13 Jun 2005 21:02:22 +0000 Subject: check wether mask is NULL in if_group_routechange before dereferencing --- sys/net/if.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/net/if.c') diff --git a/sys/net/if.c b/sys/net/if.c index 36ccbee3ecd..ce489f154f9 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.133 2005/06/12 00:41:33 henning Exp $ */ +/* $OpenBSD: if.c,v 1.134 2005/06/13 21:02:21 henning Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1767,14 +1767,14 @@ if_group_routechange(struct sockaddr *dst, struct sockaddr *mask) switch (dst->sa_family) { case AF_INET: if (satosin(dst)->sin_addr.s_addr == INADDR_ANY && - satosin(mask)->sin_addr.s_addr == INADDR_ANY) + mask && satosin(mask)->sin_addr.s_addr == INADDR_ANY) if_group_ext_build(); break; #ifdef INET6 case AF_INET6: if (IN6_ARE_ADDR_EQUAL(&(satosin6(dst))->sin6_addr, &in6addr_any) && - IN6_ARE_ADDR_EQUAL(&(satosin6(mask))->sin6_addr, + mask && IN6_ARE_ADDR_EQUAL(&(satosin6(mask))->sin6_addr, &in6addr_any)) if_group_ext_build(); break; -- cgit v1.2.3