diff options
author | Mark Spencer <markster@digium.com> | 2005-10-21 14:09:03 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-10-21 14:09:03 +0000 |
commit | f5d5814f5f5a26998df67272f7b2903c54a9b17f (patch) | |
tree | ee841405f66fdcff8a049e430504f7d3dd60191f /utils.c | |
parent | e60ab6d91669904f246b1f7ba95ba7765fb3f26f (diff) |
Fix segfault in CVS head (sorry about that)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'utils.c')
-rwxr-xr-x | utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |