diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-09-09 15:44:10 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-09-09 15:44:10 +0000 |
commit | 4f077691bca39763cc0b6bf304de588068244c73 (patch) | |
tree | 4844c6e383339b0e2d7f0361fd4cdf6c50753440 /main | |
parent | 7eb76962396eb53a96ef43aa28984d315d6c251e (diff) |
Merged revisions 142063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r142063 | russell | 2008-09-09 10:40:24 -0500 (Tue, 09 Sep 2008) | 5 lines
Ensure that the stored CDR reference is still valid after the bridge before
poking at it. Also, keep the channel locked while messing with this CDR.
(fixes crashes reported in issue #13409)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/features.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/main/features.c b/main/features.c index b49f9c8b6..e81a24f59 100644 --- a/main/features.c +++ b/main/features.c @@ -2345,6 +2345,22 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast ast_cdr_specialized_reset(chan->cdr,0); } if (peer->cdr) { + struct ast_cdr *cur; + + ast_channel_lock(peer); + for (cur = peer->cdr; cur; cur = cur->next) { + if (cur == orig_peer_cdr) { + break; + } + } + + if (!cur) { + /* orig_peer_cdr is gone, probably because of a masquerade + * during the bridge. */ + ast_channel_unlock(peer); + return res; + } + /* before resetting the peer cdr, throw a copy of it to the backend, just in case the cdr.conf file is calling for unanswered CDR's. */ @@ -2361,6 +2377,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast } } ast_cdr_specialized_reset(orig_peer_cdr,0); + ast_channel_unlock(peer); } } return res; |