aboutsummaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-21 14:09:03 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-21 14:09:03 +0000
commitc29b82874d658c39a7ff673ce3b96d64d1b9ff34 (patch)
treeee841405f66fdcff8a049e430504f7d3dd60191f /utils.c
parenta2447d37bb8f5620bc3c4dc7446de6bbfe21524e (diff)
Fix segfault in CVS head (sorry about that)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6839 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils.c')
-rwxr-xr-xutils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index d73e76e62..dca0dfd49 100755
--- a/utils.c
+++ b/utils.c
@@ -191,7 +191,9 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
/* Forge a reply for IP's to avoid octal IP's being interpreted as octal */
if (dots != 3)
return NULL;
- hp->hp.h_addr = hp->buf;
+ memset(hp, 0, sizeof(struct ast_hostent));
+ hp->hp.h_addr_list = hp->buf;
+ hp->hp.h_addr = hp->buf + sizeof(void *);
if (inet_pton(AF_INET, host, hp->hp.h_addr) > 0)
return &hp->hp;
return NULL;