[Home]

Summary:ASTERISK-10566: False detection of USERSTOPPED status
Reporter:Christophe Sollet (cfc)Labels:
Date Opened:2007-10-18 06:16:14Date Closed:2007-10-22 10:58:07
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_controlplayback
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:in app_controlplayback.c, function controlplayback_exec() :

      /* If we stopped on one of our stop keys, return 0  */
       if (argv[arg_stop] && strchr(argv[arg_stop], res)) {

res is not checked to be > 0.
In the case the user listen the file without pressing a stop key, ast_control_streamfile will return 0.
In this case, strchr will match the end of string of arg_stop and CPLAYBACKSTATUS will be wrongly set to USERSTOPPED (should be SUCCESS)

Comments:By: Digium Subversion (svnbot) 2007-10-19 11:18:20

Repository: asterisk
Revision: 86502

U   branches/1.4/main/app.c

------------------------------------------------------------------------
r86502 | file | 2007-10-19 11:18:20 -0500 (Fri, 19 Oct 2007) | 4 lines

When returning a DTMF digit from ast_control_streamfile cast it as a char so that 0 does not overlap with the success return code.
(closes issue ASTERISK-10566)
Reported by: cfc

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

By: Digium Subversion (svnbot) 2007-10-19 11:20:05

Repository: asterisk
Revision: 86503

_U  trunk/
U   trunk/main/app.c

------------------------------------------------------------------------
r86503 | file | 2007-10-19 11:20:05 -0500 (Fri, 19 Oct 2007) | 12 lines

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

........
r86502 | file | 2007-10-19 13:38:29 -0300 (Fri, 19 Oct 2007) | 4 lines

When returning a DTMF digit from ast_control_streamfile cast it as a char so that 0 does not overlap with the success return code.
(closes issue ASTERISK-10566)
Reported by: cfc

........

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

By: Christophe Sollet (cfc) 2007-10-22 07:09:12

r86502 seems to don't fix the issue :

casting a 0 ('\0') as a char is still equal to 0

res should be tested to be > 0 so strchr will not match the end of string ('\0') of arg_stop in controlplayback_exec()

By: Digium Subversion (svnbot) 2007-10-22 10:54:23

Repository: asterisk
Revision: 86754

U   branches/1.4/apps/app_controlplayback.c

------------------------------------------------------------------------
r86754 | file | 2007-10-22 10:54:23 -0500 (Mon, 22 Oct 2007) | 4 lines

Make sure res is a positive value before performing the check to determine whether the user stopped it or not.
(closes issue ASTERISK-10566)
Reported by: cfc

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

By: Digium Subversion (svnbot) 2007-10-22 10:58:07

Repository: asterisk
Revision: 86755

_U  trunk/
U   trunk/apps/app_controlplayback.c

------------------------------------------------------------------------
r86755 | file | 2007-10-22 10:58:07 -0500 (Mon, 22 Oct 2007) | 12 lines

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

........
r86754 | file | 2007-10-22 13:15:18 -0300 (Mon, 22 Oct 2007) | 4 lines

Make sure res is a positive value before performing the check to determine whether the user stopped it or not.
(closes issue ASTERISK-10566)
Reported by: cfc

........

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