]> granicus.if.org Git - php/commitdiff
- Hopefully fix strip_tags bug
authorZeev Suraski <zeev@php.net>
Sun, 13 Feb 2000 15:35:51 +0000 (15:35 +0000)
committerZeev Suraski <zeev@php.net>
Sun, 13 Feb 2000 15:35:51 +0000 (15:35 +0000)
@- Fix overrun in strip_tags (Stas, Zend library)

ext/standard/string.c

index 3768e4fcca775376f98074ef36d90387fce9292c..ed847c4d82fb6e9aedfa44a6945b1756eca00104 100644 (file)
@@ -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;