Skip to content
Snippets Groups Projects
Commit 762cd462 authored by Anthony Minessale II's avatar Anthony Minessale II
Browse files

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
parent a23534c4
No related branches found
No related tags found
No related merge requests found
......@@ -415,7 +415,7 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
{
struct timeval started, ended;
long elapsed = 0,last_elapsed =0;
char *breaks;
char *breaks=NULL;
int blen=2;
int res=0;
......@@ -424,11 +424,12 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
if (pause)
blen += strlen(pause);
breaks = alloca(blen + 1);
breaks[0] = '\0';
strcat(breaks, stop);
strcat(breaks, pause);
if(blen > 2) {
breaks = alloca(blen + 1);
breaks[0] = '\0';
strcat(breaks, stop);
strcat(breaks, pause);
}
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment