From: Moriyoshi Koizumi Date: Mon, 24 Feb 2003 22:19:36 +0000 (+0000) Subject: Fixed possible buffer overflow of php_strip_tags X-Git-Tag: RELEASE_0_5~774 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f341f6a194a4db6f6cc587cf624167321183a19;p=php Fixed possible buffer overflow of php_strip_tags --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 77966c9726..e21cf53f06 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3746,7 +3746,9 @@ reg_char: c = *(++p); i++; } - *rp = '\0'; + if (rp < rbuf + len) { + *rp = '\0'; + } efree(buf); if (allow) efree(tbuf);