com php-src: Fix bounds check in strip_tags(): ext/st andard/string.c
| From: | Nikita Popov | Date: | Sat, 13 Feb 2016 16:47:30 +0000 |
| Subject: | com php-src: Fix bounds check in strip_tags(): ext/st andard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91002@lists.php.net to get a copy of this message | ||
Commit: 4e0134c6618844f076d40fb346e78b89e98c825c
Author: Nikita Popov <nikic@php.net> Sat, 13 Feb 2016 17:47:30 +0100
Parents: adcdb4f7bab6a0c59fbcca108fac526d8ede70e6
Branches: PHP-5.6 PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4e0134c6618844f076d40fb346e78b89e98c825c
Log:
Fix bounds check in strip_tags()
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index bcfc3b6..d5f83e7 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4822,7 +4822,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char
*allow,
* state == 2 (PHP). Switch back to HTML.
*/
- if (state == 2 && p > buf+2 && strncasecmp(p-4, "<?xm", 4) ==
0) {
+ if (state == 2 && p > buf+4 && strncasecmp(p-4, "<?xm", 4) ==
0) {
state = 1; is_xml=1;
break;
}