summaryrefslogtreecommitdiff
path: root/asterisk.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-05-07 20:15:45 +0000
committerMark Spencer <markster@digium.com>2004-05-07 20:15:45 +0000
commit1057e70da0c08857abe7d25b748b93ae81825edd (patch)
treeccfa61275265a724e2900461d6871a6e29e5863a /asterisk.c
parent1d7c058f08c822c0d076c785176759b7b653ef10 (diff)
Check that hp->h_addr is not NULL before returning success (bug #1576)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/asterisk.c b/asterisk.c
index b4a643504..9106a5621 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -1851,7 +1851,7 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
res = gethostbyname_r(host, &hp->hp, hp->buf, sizeof(hp->buf), &result, &herrno);
- if (res)
+ if (res || !hp->hp.h_addr)
return NULL;
return &hp->hp;
}