For FreeBSD, at least, the ifa_addr element could be NULL.

(closes issue #12300)
 Reported by: festr
 Patches: 
       acl.c.patch uploaded by festr (license 443)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-03-27 19:23:12 +00:00
parent 8a02ac6f79
commit cb67f98a5a

View File

@@ -185,7 +185,7 @@ static int get_local_address(struct in_addr *ourip)
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__)
for (ifap = ifaphead; ifap; ifap = ifap->ifa_next) {
if (ifap->ifa_addr->sa_family == AF_INET) {
if (ifap->ifa_addr && ifap->ifa_addr->sa_family == AF_INET) {
sin = (const struct sockaddr_in *) ifap->ifa_addr;
score_address(sin, &best_addr, &best_score);
res = 0;