Summary:ASTERISK-02955: Using SetVar Incorrectly Causes Asterisk Process to Crash
Reporter:Leif Madsen (lmadsen)Labels:
Date Opened:2004-12-09 19:34:51.000-0600Date Closed:2008-01-15 15:16:12.000-0600
Versions:Frequency of
Environment:Attachments:( 0) 20041209__ast_expr_null_deref.diff.txt
Description:After mistakenly using the SetVar command incorrectly, the Asterisk process is promptly destroyed.  My belief is that Asterisk should be able to catch this error and simply give a WARNING on the CLI without killing the entire process.

If more information is required, I'm happy to provide it.


   -- Executing SetVar("SIP/1000-831b", "pincheck=pincheck + 1") in new stack
Dec  9 20:30:53 WARNING[10946]: ast_expr.y:654 op_plus: non-numeric argument
Disconnected from Asterisk server
Executing last minute cleanups
Asterisk cleanly ending (0).
Comments:By: Tilghman Lesher (tilghman) 2004-12-09 20:48:19.000-0600

Here's one way to fix it... by modifying ast_expr.y to never return NULL on error, but act as if the missing operand is a zero.

By: Leif Madsen (lmadsen) 2004-12-09 21:37:39.000-0600

Works great.  No more crashes.

By: Mark Spencer (markster) 2004-12-10 18:04:31.000-0600

Fixed in CVS head, thanks!

By: Russell Bryant (russell) 2004-12-10 18:22:40.000-0600

fixed in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:16:11.000-0600

Repository: asterisk
Revision: 4419

U   trunk/ast_expr.y

r4419 | markster | 2008-01-15 15:16:11 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix setvar issue (bug ASTERISK-2955)



By: Digium Subversion (svnbot) 2008-01-15 15:16:12.000-0600

Repository: asterisk
Revision: 4420

U   branches/v1-0/ast_expr.y

r4420 | russell | 2008-01-15 15:16:12 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix setvar issue (bug ASTERISK-2955)