mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
ast_control_streamfile caused seg with null stop or pause chars
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
5
app.c
5
app.c
@@ -415,7 +415,7 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
|
|||||||
{
|
{
|
||||||
struct timeval started, ended;
|
struct timeval started, ended;
|
||||||
long elapsed = 0,last_elapsed =0;
|
long elapsed = 0,last_elapsed =0;
|
||||||
char *breaks;
|
char *breaks=NULL;
|
||||||
int blen=2;
|
int blen=2;
|
||||||
int res=0;
|
int res=0;
|
||||||
|
|
||||||
@@ -424,11 +424,12 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
|
|||||||
if (pause)
|
if (pause)
|
||||||
blen += strlen(pause);
|
blen += strlen(pause);
|
||||||
|
|
||||||
|
if(blen > 2) {
|
||||||
breaks = alloca(blen + 1);
|
breaks = alloca(blen + 1);
|
||||||
breaks[0] = '\0';
|
breaks[0] = '\0';
|
||||||
strcat(breaks, stop);
|
strcat(breaks, stop);
|
||||||
strcat(breaks, pause);
|
strcat(breaks, pause);
|
||||||
|
}
|
||||||
if (chan->_state != AST_STATE_UP)
|
if (chan->_state != AST_STATE_UP)
|
||||||
res = ast_answer(chan);
|
res = ast_answer(chan);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user