aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-04 20:52:11 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-04 20:52:11 +0000
commit76e741a54b997b0a21f5bb7a48df61fcdd672669 (patch)
treea706e0fba5b58e01f6a6e255b90c04b6a95d9781 /channels
parent4a272db2d0ad731e3794184786ae9e4478dbb75c (diff)
Merged revisions 154366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r154366 | tilghman | 2008-11-04 14:51:18 -0600 (Tue, 04 Nov 2008) | 16 lines Merged revisions 154365 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r154365 | tilghman | 2008-11-04 14:49:33 -0600 (Tue, 04 Nov 2008) | 9 lines On busy systems, it's possible for the values checked within a single line of code to change, unless the structure is locked to ensure a consistent state. (closes issue #13717) Reported by: kowalma Patches: 20081102__bug13717.diff.txt uploaded by Corydon76 (license 14) Tested by: kowalma ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@154367 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 6f26cf615..0ed11e070 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1703,12 +1703,21 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
/* This will occur on the first response to a message that we initiated,
* such as a PING. */
+ if (dcallno) {
+ ast_mutex_lock(&iaxsl[dcallno]);
+ }
if (callno && dcallno && iaxs[dcallno] && !iaxs[dcallno]->peercallno && match(sin, callno, dcallno, iaxs[dcallno], check_dcallno)) {
iaxs[dcallno]->peercallno = callno;
res = dcallno;
store_by_peercallno(iaxs[dcallno]);
+ if (!res || !return_locked) {
+ ast_mutex_unlock(&iaxsl[dcallno]);
+ }
return res;
}
+ if (dcallno) {
+ ast_mutex_unlock(&iaxsl[dcallno]);
+ }
#ifdef IAX_OLD_FIND
/* If we get here, we SHOULD NOT find a call structure for this