mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user