dect
/
asterisk
Archived
13
0
Fork 0

Fix segfault in CVS head (sorry about that)

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6839 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2005-10-21 14:09:03 +00:00
parent a2447d37bb
commit c29b82874d
1 changed files with 3 additions and 1 deletions

View File

@ -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;