[asterisk-commits] russell: branch 1.4 r74767 - in /branches/1.4: ./ channels/chan_iax2.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jul 11 17:57:08 CDT 2007
Author: russell
Date: Wed Jul 11 17:57:07 2007
New Revision: 74767
URL: http://svn.digium.com/view/asterisk?view=rev&rev=74767
Log:
Merged revisions 74766 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r74766 | russell | 2007-07-11 17:53:26 -0500 (Wed, 11 Jul 2007) | 5 lines
The function make_trunk() can fail and return -1 instead of a valid new call
number. Fix the uses of this function to handle this instead of treating it
as the new call number. This would cause a deadlock and memory corruption.
(possible cause of issue #9614 and others, patch by me)
........
Modified:
branches/1.4/ (props changed)
branches/1.4/channels/chan_iax2.c
Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=74767&r1=74766&r2=74767
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Wed Jul 11 17:57:07 2007
@@ -6969,7 +6969,9 @@
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
if (ast_test_flag(iaxs[fr->callno], IAX_TRUNK)) {
- fr->callno = make_trunk(fr->callno, 1);
+ int new_callno;
+ if ((new_callno = make_trunk(fr->callno, 1)) != -1)
+ fr->callno = new_callno;
}
/* For security, always ack immediately */
if (delayreject)
@@ -8229,8 +8231,11 @@
/* If this is a trunk, update it now */
ast_copy_flags(iaxs[callno], &cai, IAX_TRUNK | IAX_SENDANI | IAX_NOTRANSFER | IAX_TRANSFERMEDIA | IAX_USEJITTERBUF | IAX_FORCEJITTERBUF);
- if (ast_test_flag(&cai, IAX_TRUNK))
- callno = make_trunk(callno, 1);
+ if (ast_test_flag(&cai, IAX_TRUNK)) {
+ int new_callno;
+ if ((new_callno = make_trunk(callno, 1)) != -1)
+ callno = new_callno;
+ }
iaxs[callno]->maxtime = cai.maxtime;
if (cai.found)
ast_string_field_set(iaxs[callno], host, pds.peer);
More information about the asterisk-commits
mailing list