From a7a964cdbf2ff45a2ade435e0dbb64638f7daf3c Mon Sep 17 00:00:00 2001 From: kcwu Date: Tue, 23 Aug 2005 06:10:15 +0000 Subject: fix buffer overflow. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3076 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/io.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mbbsd') diff --git a/mbbsd/io.c b/mbbsd/io.c index bf7eb91e..b3188145 100644 --- a/mbbsd/io.c +++ b/mbbsd/io.c @@ -672,6 +672,7 @@ strip_ansi(char *buf, const char *str, int mode) const char* p = str + 1; if( *p != '[' ){ ++str; + if(*str=='\0') break; continue; } while(isEscapeParam(*++p)); @@ -685,6 +686,7 @@ strip_ansi(char *buf, const char *str, int mode) count += len; } str = p; + if(*str=='\0') break; } if( buf ) *buf = 0; -- cgit v1.2.3