diff options
author | guy <guy> | 2003-09-10 23:06:43 +0000 |
---|---|---|
committer | guy <guy> | 2003-09-10 23:06:43 +0000 |
commit | bf56c44d219f893b8560d4c600fdf6f915090294 (patch) | |
tree | a1905f430fe2034e577d2cb3c4e772ddcd2d9c89 /fad-getad.c | |
parent | ea2d307af214f30efcde4cb53cddd2db4b2f37d8 (diff) | |
download | libpcap-bf56c44d219f893b8560d4c600fdf6f915090294.tar.gz |
From Mike Wiacek: have "get_sa_len()" return 0 if the "addr" pointer
passed to it is NULL, as it might be if, for example, the address or the
netmask isn't supplied.
Diffstat (limited to 'fad-getad.c')
-rw-r--r-- | fad-getad.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fad-getad.c b/fad-getad.c index 8ff9ea91..ba68b025 100644 --- a/fad-getad.c +++ b/fad-getad.c @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/fad-getad.c,v 1.6 2003-09-10 22:29:55 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/fad-getad.c,v 1.7 2003-09-10 23:06:43 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -89,6 +89,8 @@ static const char rcsid[] = static size_t get_sa_len(struct sockaddr *addr) { + if (!addr) + return (0); switch (addr->sa_family) { #ifdef AF_INET |