]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Protect ast_filestream object when on a channel
authorRussell Bryant <russell@russellbryant.com>
Mon, 27 Jan 2014 01:14:19 +0000 (01:14 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 27 Jan 2014 01:14:19 +0000 (01:14 +0000)
commitb619a405a58b18747d892d39fdaa9875ebc71fd5
tree78a5a47910c3eefe5d7b5814ec11209ae3df25c9
parent7a86a88090e564cada4ba1b21e37ca780d79eeac
Protect ast_filestream object when on a channel

The ast_filestream object gets tacked on to a channel via
chan->timingdata.  It's a reference counted object, but the reference
count isn't used when putting it on a channel.  It's theoretically
possible for another thread to interfere with the channel while it's
unlocked and cause the filestream to get destroyed.

Use the astobj2 reference count to make sure that as long as this code
path is holding on the ast_filestream and passing it into the file.c
playback code, that it knows it's valid.

Bug reported by Leif Madsen.

Review: https://reviewboard.asterisk.org/r/3135/
........

Merged revisions 406566 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@406567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/channel.h
main/channel.c
main/file.c