Summary:ASTERISK-00406: Segmentationfault caused by "Originate" through manager interface
Reporter:thaeger (thaeger)Labels:
Date Opened:2003-10-21 07:34:16Date Closed:2008-01-15 14:36:41.000-0600
Versions:Frequency of
Environment:Attachments:( 0) 409.diff
( 1) 409v2.diff
Description:If you have a connection to * through the manager interface and make a "Originate" (after Login) with "Context:","Extension:","Priority:", when the call is answered he comes not to the specified context and then a segfault occurs.
Comments:By: jshugart (jshugart) 2003-10-22 13:23:49

I found this also. It is a problem in the parsing of the variables.  The originate function passes NULL to ast_pbx_outgoing_exten for variable, which crashes the strtok_r function.  It appears to only occur when calling the function in sync mode.  I was looking over a patch for this, but have not had time to submit it.  Can you check to see if you are passing a 1 for the sync flag?

By: thaeger (thaeger) 2003-10-23 03:34:29

Hi jshugart ,

no, the sync option is set to 0.

By: Thorsten Lockert (tholo) 2003-10-25 16:20:10

Description of problems was good enough to track down the cause of the crash, and patch has been uploaded.

By: Thorsten Lockert (tholo) 2003-10-25 17:08:30

This actually was happening in two places, plus the code was modifying a string it should not be when a non-NULL pointer was passed.  The second version of the patch takes care of this...

By: Mark Spencer (markster) 2003-10-26 16:42:46.000-0600

Fixed in CVS

By: Digium Subversion (svnbot) 2008-01-15 14:36:41.000-0600

Repository: asterisk
Revision: 1675

U   trunk/pbx.c

r1675 | markster | 2008-01-15 14:36:41 -0600 (Tue, 15 Jan 2008) | 2 lines

Make sure variables exists (bug ASTERISK-406)