summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguy <guy>2003-09-10 23:06:43 +0000
committerguy <guy>2003-09-10 23:06:43 +0000
commitbf56c44d219f893b8560d4c600fdf6f915090294 (patch)
treea1905f430fe2034e577d2cb3c4e772ddcd2d9c89
parentea2d307af214f30efcde4cb53cddd2db4b2f37d8 (diff)
downloadlibpcap-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.
-rw-r--r--CREDITS1
-rw-r--r--fad-getad.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/CREDITS b/CREDITS
index 9965863d..96241055 100644
--- a/CREDITS
+++ b/CREDITS
@@ -50,6 +50,7 @@ Additional people who have contributed patches:
Maciej W. Rozycki <macro@ds2.pg.gda.pl>
Marcus Felipe Pereira <marcus@task.com.br>
Martin Husemann <martin@netbsd.org>
+ Mike Wiacek <mike@iroot.net>
Monroe Williams <monroe@pobox.com>
Octavian Cerna <tavy@ylabs.com>
Olaf Kirch <okir@caldera.de>
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