[asterisk-commits] file: branch 1.4 r103768 - /branches/1.4/main/asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 18 10:11:51 CST 2008


Author: file
Date: Mon Feb 18 10:11:51 2008
New Revision: 103768

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103768
Log:
Backport fix from issue #9325.
(closes issue #11980)
Reported by: rbrunka

Modified:
    branches/1.4/main/asterisk.c

Modified: branches/1.4/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/asterisk.c?view=diff&rev=103768&r1=103767&r2=103768
==============================================================================
--- branches/1.4/main/asterisk.c (original)
+++ branches/1.4/main/asterisk.c Mon Feb 18 10:11:51 2008
@@ -1721,7 +1721,8 @@
 	struct pollfd fds[2];
 	int res;
 	int max;
-	char buf[512];
+#define EL_BUF_SIZE 512
+	char buf[EL_BUF_SIZE];
 
 	for (;;) {
 		max = 1;
@@ -1784,7 +1785,7 @@
 			if (!ast_opt_exec && !lastpos)
 				write(STDOUT_FILENO, "\r", 1);
 			write(STDOUT_FILENO, buf, res);
-			if ((buf[res-1] == '\n') || (buf[res-2] == '\n')) {
+			if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (buf[res-2] == '\n'))) {
 				*cp = CC_REFRESH;
 				return(1);
 			} else {




More information about the asterisk-commits mailing list