From 8f341f6a194a4db6f6cc587cf624167321183a19 Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Mon, 24 Feb 2003 22:19:36 +0000 Subject: [PATCH] Fixed possible buffer overflow of php_strip_tags --- ext/standard/string.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.50.1