From: Zeev Suraski Date: Sun, 13 Feb 2000 15:35:51 +0000 (+0000) Subject: - Hopefully fix strip_tags bug X-Git-Tag: BEFORE_SAPI_POST_PATCH_17_FEB_2000~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ae0902498ab5e74162233dcd5d74f1b7039d33b;p=php - Hopefully fix strip_tags bug @- Fix overrun in strip_tags (Stas, Zend library) --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 3768e4fcca..ed847c4d82 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2265,8 +2265,8 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo if(allow) { *(tp++) = '>'; *tp='\0'; - if(php_tag_find(tbuf, tp-tbuf, allow)) { - memcpy(rp,tbuf,tp-tbuf); + if(php_tag_find(tbuf, tp-tbuf+1, allow)) { + memcpy(rp,tbuf,tp-tbuf+1); rp += tp-tbuf; } tp = tbuf;