summaryrefslogtreecommitdiff
path: root/apps/app_externalivr.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2012-03-14 10:05:07 +0000
committerRussell Bryant <russell@russellbryant.com>2012-03-14 10:05:07 +0000
commit6c9f009b6d208eeb656bc19ec2e1675f755c73a9 (patch)
tree633ffe92585dff903df0d7b0b79c3de1cecba5fe /apps/app_externalivr.c
parent6ac425df31c1545348a64780f61fbd4e8ca9c57c (diff)
Fix invalid reads/writes due to incorrect sizeof().
These few places in the code used sizeof() on h_addr in struct hostent. This is sizeof(char *). The correct way to get the size of this address is to use h_length. This error would result in reads/writes of 8 bytes instead of 4 on 64-bit machines. ........ Merged revisions 359211 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359212 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_externalivr.c')
-rw-r--r--apps/app_externalivr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c
index 0dee58cea..5a320002b 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -515,7 +515,7 @@ static int app_exec(struct ast_channel *chan, const char *data)
ast_gethostbyname(hostname, &hp);
remote_address_tmp.sin_family = AF_INET;
remote_address_tmp.sin_port = htons(port);
- memcpy(&remote_address_tmp.sin_addr.s_addr, hp.hp.h_addr, sizeof(hp.hp.h_addr));
+ memcpy(&remote_address_tmp.sin_addr.s_addr, hp.hp.h_addr, hp.hp.h_length);
ast_sockaddr_from_sin(&ivr_desc.remote_address, &remote_address_tmp);
if (!(ser = ast_tcptls_client_create(&ivr_desc)) || !(ser = ast_tcptls_client_start(ser))) {
goto exit;