From 42358325a8bb1c706fd4cfcec0a1522ec1eb8ae6 Mon Sep 17 00:00:00 2001
From: Tilghman Lesher <tilghman@meg.abyt.es>
Date: Thu, 27 Mar 2008 19:26:45 +0000
Subject: [PATCH] Merged revisions 111442 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r111442 | tilghman | 2008-03-27 14:23:12 -0500 (Thu, 27 Mar 2008) | 6 lines

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/trunk@111443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/acl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main/acl.c b/main/acl.c
index 22248648fd..9a141a3735 100644
--- a/main/acl.c
+++ b/main/acl.c
@@ -144,7 +144,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;
-- 
GitLab