diff options
author | Matthew Jordan <mjordan@digium.com> | 2012-02-22 14:54:42 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2012-02-22 14:54:42 +0000 |
commit | a8d9e0bf0bf0eeaf334fe0a8c3cf66d46b6d9a42 (patch) | |
tree | 513379653cb07a79fc960892bd14947854053498 /UPGRADE-1.4.txt | |
parent | 3a9ac7c10cb5ed3dd5b3bcd839f566572b1fb564 (diff) |
Merged revisions 356215 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10
................
r356215 | mjordan | 2012-02-22 08:53:53 -0600 (Wed, 22 Feb 2012) | 32 lines
Merged revisions 356214 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r356214 | mjordan | 2012-02-22 08:50:20 -0600 (Wed, 22 Feb 2012) | 27 lines
Fix potential buffer overrun and memory leak when executing "sip show peers"
The "sip show peers" command uses a fix sized array to sort the current peers
in the peers ao2_container. The size of the array is based on the current
number of peers in the container. However, once the size of the array is
determined, the number of peers in the container can change, as the peers
container is not locked. This could cause a buffer overrun when populating
the array, if peers were added to the container after the array was created.
Additionally, a memory leak of the allocated array would occur if a user
caused the _show_peers method to return CLI_SHOWUSAGE.
We now create a snapshot of the current peers using an ao2_callback with the
OBJ_MULTIPLE flag. This size of the array is set to the number of peers
that the iterator will iterate over; hence, if peers are added or removed
from the peers container it will not affect the execution of the "sip show
peers" command.
Review: https://reviewboard.asterisk.org/r/1738/
(closes issue ASTERISK-19231)
(closes issue ASTERISK-19361)
Reported by: Thomas Arimont, Jamuel Starkey
Tested by: Thomas Arimont, Jamuel Starkey
Patches: sip_show_peers_2012_02_16.diff uploaded by mjordan (license 6283)
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'UPGRADE-1.4.txt')
0 files changed, 0 insertions, 0 deletions