From 017a6353d1f45d3462b2526046e28c7457e49bc1 Mon Sep 17 00:00:00 2001 From: "Thies C. Arntzen" Date: Sun, 13 Feb 2000 14:56:35 +0000 Subject: [PATCH] @- Fixed crash in strip_tags() and related functions. (Thies) --- ext/standard/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 9a3dacc7a9..3768e4fcca 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2058,7 +2058,7 @@ PHP_FUNCTION(strip_tags) break; } convert_to_string_ex(str); - buf = estrdup((*str)->value.str.val); + buf = estrndup((*str)->value.str.val,(*str)->value.str.len); php_strip_tags(buf, (*str)->value.str.len, 0, allowed_tags, allowed_tags_len); RETURN_STRING(buf, 0); } @@ -2210,7 +2210,7 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo char *tbuf, *buf, *p, *tp, *rp, c, lc; int br, i=0; - buf = estrdup(rbuf); + buf = estrndup(rbuf,len); c = *buf; lc = '\0'; p = buf; -- 2.50.1