[asterisk-commits] anthonyl: branch anthonyl/escape-filter2 r47742 -
/team/anthonyl/escape-filte...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Nov 16 09:37:11 MST 2006
Author: anthonyl
Date: Thu Nov 16 10:37:10 2006
New Revision: 47742
URL: http://svn.digium.com/view/asterisk?view=rev&rev=47742
Log:
be safe use strlen.
Modified:
team/anthonyl/escape-filter2/main/term.c
Modified: team/anthonyl/escape-filter2/main/term.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/escape-filter2/main/term.c?view=diff&rev=47742&r1=47741&r2=47742
==============================================================================
--- team/anthonyl/escape-filter2/main/term.c (original)
+++ team/anthonyl/escape-filter2/main/term.c Thu Nov 16 10:37:10 2006
@@ -18,9 +18,9 @@
/*! \file
*
- * \brief Terminal Routines
- *
- * \author Mark Spencer <markster at digium.com>
+ * \brief Terminal Routines
+ *
+ * \author Mark Spencer <markster at digium.com>
*/
#include "asterisk.h"
@@ -269,9 +269,9 @@
void term_filter_escapes(char *line)
{
int i;
-
- for (i=0; i < strlen(line); i++) {
- if (line[i] == ESC) {
+
+ for (i=0; i < strlen(line)-2; i++) {
+ if (line[i] == ESC) {
if (line[i+1] == '\x5b') {
switch (line[i+2]) {
case '\x30':
@@ -288,7 +288,7 @@
/* replace ESC with a space */
line[i] = ' ';
}
- }
+ }
}
}
More information about the asterisk-commits
mailing list