diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-01-19 17:58:11 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-01-19 17:58:11 +0000 |
commit | 00b51a864761d466de8c1a9b3d2155eb7dfd1ead (patch) | |
tree | 6dbac271cafb620ccdf1fc13c7a1423c0ef44c37 /main | |
parent | 2b97463af6d550e4e171ff0cb7305c62677c53cd (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.8@302505 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c index 687a6ec42..2f7086a0d 100644 --- a/main/utils.c +++ b/main/utils.c @@ -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; |