[Asterisk-cvs] asterisk app.c,1.26,1.27

anthm at lists.digium.com anthm at lists.digium.com
Thu Sep 23 10:42:42 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv26740

Modified Files:
	app.c 
Log Message:
ast_control_streamfile caused seg with null stop or pause chars

Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- app.c	17 Sep 2004 15:05:29 -0000	1.26
+++ app.c	23 Sep 2004 14:46:09 -0000	1.27
@@ -415,7 +415,7 @@
 {
 	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 @@
 	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);
 




More information about the svn-commits mailing list