Merged revisions 302504 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r302504 | seanbright | 2011-01-19 12:56:32 -0500 (Wed, 19 Jan 2011) | 7 lines
  
  Make sure that h_length is set when we short-circuit out of ast_gethostbyname.
  
  (closes issue #16135)
  Reported by: thedavidfactor
  Patches:
        utils.patch uploaded by thedavidfactor (license 903)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@302505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Sean Bright
2011-01-19 17:58:11 +00:00
parent aa7a044fe6
commit 01e8f4ef1b

View File

@@ -208,6 +208,8 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
hp->hp.h_addrtype = AF_INET;
hp->hp.h_addr_list = (void *) hp->buf;
hp->hp.h_addr = hp->buf + sizeof(void *);
/* For AF_INET, this will always be 4 */
hp->hp.h_length = 4;
if (inet_pton(AF_INET, host, hp->hp.h_addr) > 0)
return &hp->hp;
return NULL;