[Home]

Summary:ASTERISK-13655: [patch] app_playtones segfaults asterisk when invalid tone is specified.
Reporter:Alec Davis (alecdavis)Labels:
Date Opened:2009-02-26 03:15:24.000-0600Date Closed:2009-02-26 19:01:46.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Core/PBX
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) playtones_invalidtone.diff.txt
Description:Although a Dialplan mistake, asterisk shouldn't crash!!

'iring' is a typo in the dialplan. Common problem for VI users.

will crash very shorty after Playtones(iring)

Also. app_playtones is not available to report issues on, hence 'core/pbx'.

****** ADDITIONAL INFORMATION ******

example dialplan:

exten => 8593,1,Playtones(ring)
exten => 8593,n,Wait(5)
exten => 8593,n,Playtones(iring)
exten => 8593,n,Wait(5)
exten => 8593,n,Hangup

console output:
   -- Executing [8593@trusted:1] PlayTones("IAX2/aldhome-2071", "ring") in new stack
   -- Executing [8593@trusted:2] Wait("IAX2/aldhome-2071", "5") in new stack
   -- Executing [8593@trusted:3] PlayTones("IAX2/aldhome-2071", "iring") in new stack
[Feb 26 22:02:33] ERROR[23403]: indications.c:339 ast_playtones_start: Failed to parse tone part 'iring'
   -- Executing [8593@trusted:4] Wait("IAX2/aldhome-2071", "5") in new stack
astrid*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
Asterisk cleanly ending (0).
Comments:By: Alec Davis (alecdavis) 2009-02-26 03:55:58.000-0600

uploaded playtones_invalidtone.diff.txt

sanity check for ast_playtones_start, checks that at least 1 item to play before attempting to activate tone generator.

By: Digium Subversion (svnbot) 2009-02-26 09:40:27.000-0600

Repository: asterisk
Revision: 178764

U   trunk/main/indications.c

------------------------------------------------------------------------
r178764 | file | 2009-02-26 09:40:27 -0600 (Thu, 26 Feb 2009) | 5 lines

Ensure there is a valid tone part before trying to play tones.

(closes issue ASTERISK-13655)
Reported by: alecdavis

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

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

By: Digium Subversion (svnbot) 2009-02-26 09:42:33.000-0600

Repository: asterisk
Revision: 178765

_U  branches/1.6.0/

------------------------------------------------------------------------
r178765 | file | 2009-02-26 09:42:33 -0600 (Thu, 26 Feb 2009) | 11 lines

Blocked revisions 178764 via svnmerge

........
 r178764 | file | 2009-02-26 11:40:10 -0400 (Thu, 26 Feb 2009) | 5 lines
 
 Ensure there is a valid tone part before trying to play tones.
 
 (closes issue ASTERISK-13655)
 Reported by: alecdavis
........

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

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

By: Digium Subversion (svnbot) 2009-02-26 09:43:02.000-0600

Repository: asterisk
Revision: 178766

_U  branches/1.6.1/

------------------------------------------------------------------------
r178766 | file | 2009-02-26 09:43:01 -0600 (Thu, 26 Feb 2009) | 11 lines

Blocked revisions 178764 via svnmerge

........
 r178764 | file | 2009-02-26 11:40:10 -0400 (Thu, 26 Feb 2009) | 5 lines
 
 Ensure there is a valid tone part before trying to play tones.
 
 (closes issue ASTERISK-13655)
 Reported by: alecdavis
........

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

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

By: Alec Davis (alecdavis) 2009-02-26 14:27:44.000-0600

1.6.0 and 1.6.1 didn't make it.

as they have 1 line of extra code 's = strsep(&stringp,separator);' at bottom of loop in ast_playtones_start.

d.nitems++;

s = strsep(&stringp,separator);  
}

Also applies to 1.4, by code comparison.



By: Alec Davis (alecdavis) 2009-02-26 18:58:41.000-0600

False alarm with 1.6.0 1.6.1 and 1.4, they are OK, well not broken yet. They return early if a bad tone is found.

So, make a call on this one, either prevent the others ever having a problem, or this bug can be closed.