summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2011-01-19 17:59:18 +0000
committerSean Bright <sean@malleable.com>2011-01-19 17:59:18 +0000
commitbd26287e88475c59df9bd7a80c04c35e5af5a9ea (patch)
treed4a8e976445812f0f78e3f60bc8131078b8033e2
parent9d6cbe222cc0b4ab0e0c8bf0800772df72d8838b (diff)
Merged revisions 302505 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r302505 | seanbright | 2011-01-19 12:58:11 -0500 (Wed, 19 Jan 2011) | 14 lines 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/trunk@302507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--main/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c
index 6ce659c41..dd0c3187a 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -215,6 +215,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;