[Home]

Summary:ASTERISK-13353: crash in comparation with 'nothing'
Reporter:caspy (caspy)Labels:
Date Opened:2009-01-13 04:04:30.000-0600Date Closed:2009-01-13 11:52:43.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20090113__bug14226.diff.txt
Description:(i don't know which category to set, so 'General'. sorry)

i have such string in extentions.ael:
if (${IFTIME(9:01-18:59|mon-fri|*|*?1)} = 1) { goto workinghours; };
(mention, that in IFTIME function i don't set 'false' condition)

in 'dialplan show' it became looking so:
15. GotoIf($[${IFTIME(9:01-18:59|mon-fri|*|*?1)} = 1]?16:17) [pbx_ael]

and than, if i run this context at NONworking hours, asterisk crashes.
output from gdb:

Core was generated by `/usr/sbin/asterisk -f -g -q'.
Program terminated with signal 11, Segmentation fault.
#0  iftime (chan=0xb7a3ac30, cmd=0xb6e68db0 "IFTIME", data=0x0, buf=0xb6e68e20 "", len=4096) at /usr/home/caspy/compile/asterisk-1.6.0.3-rc1/include/asterisk/strings.h:196
196     AST_INLINE_API(
(gdb)


If i put 'false' condition, like:
 if (${IFTIME(9:01-18:59|mon-fri|*|*?1:0)} = 1) {....
everything becomes ok.

So, i think, this is because a comparation between digit and (NULL), but in this case any kind of error would be better than full crash. ;)
Comments:By: Leif Madsen (lmadsen) 2009-01-13 11:35:13.000-0600

I can confirm this issue. I've reproduced it on a newer version of Asterisk trunk (as of yesterday).

Adding the false return to IFTIME() makes it work correctly, but either encasing it in double quotes, or missing the false return, then Asterisk will crash.

I'll attach a backtrace here shortly.

By: Tilghman Lesher (tilghman) 2009-01-13 11:46:45.000-0600

Patch uploaded for your immediate use, but I'm going to go ahead and close this one out.

By: Digium Subversion (svnbot) 2009-01-13 11:48:01.000-0600

Repository: asterisk
Revision: 168546

U   branches/1.4/funcs/func_logic.c

------------------------------------------------------------------------
r168546 | tilghman | 2009-01-13 11:48:00 -0600 (Tue, 13 Jan 2009) | 6 lines

If either conditional is NULL, don't try copying it.
(closes issue ASTERISK-13353)
Reported by: caspy
Patches:
      20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=168546

By: Digium Subversion (svnbot) 2009-01-13 11:51:13.000-0600

Repository: asterisk
Revision: 168547

_U  trunk/
U   trunk/funcs/func_logic.c

------------------------------------------------------------------------
r168547 | tilghman | 2009-01-13 11:51:12 -0600 (Tue, 13 Jan 2009) | 13 lines

Merged revisions 168546 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r168546 | tilghman | 2009-01-13 11:48:00 -0600 (Tue, 13 Jan 2009) | 6 lines
 
 If either conditional is NULL, don't try copying it.
 (closes issue ASTERISK-13353)
  Reported by: caspy
  Patches:
        20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=168547

By: Digium Subversion (svnbot) 2009-01-13 11:51:59.000-0600

Repository: asterisk
Revision: 168548

_U  branches/1.6.0/
U   branches/1.6.0/funcs/func_logic.c

------------------------------------------------------------------------
r168548 | tilghman | 2009-01-13 11:51:59 -0600 (Tue, 13 Jan 2009) | 20 lines

Merged revisions 168547 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r168547 | tilghman | 2009-01-13 11:51:12 -0600 (Tue, 13 Jan 2009) | 13 lines
 
 Merged revisions 168546 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r168546 | tilghman | 2009-01-13 11:48:00 -0600 (Tue, 13 Jan 2009) | 6 lines
   
   If either conditional is NULL, don't try copying it.
   (closes issue ASTERISK-13353)
    Reported by: caspy
    Patches:
          20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=168548

By: Digium Subversion (svnbot) 2009-01-13 11:52:42.000-0600

Repository: asterisk
Revision: 168549

_U  branches/1.6.1/
U   branches/1.6.1/funcs/func_logic.c

------------------------------------------------------------------------
r168549 | tilghman | 2009-01-13 11:52:42 -0600 (Tue, 13 Jan 2009) | 20 lines

Merged revisions 168547 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r168547 | tilghman | 2009-01-13 11:51:12 -0600 (Tue, 13 Jan 2009) | 13 lines
 
 Merged revisions 168546 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r168546 | tilghman | 2009-01-13 11:48:00 -0600 (Tue, 13 Jan 2009) | 6 lines
   
   If either conditional is NULL, don't try copying it.
   (closes issue ASTERISK-13353)
    Reported by: caspy
    Patches:
          20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=168549