1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 00:48:25 +02:00

More checks for php_strip_tags_ex

This commit is contained in:
Stanislav Malyshev
2020-01-22 22:36:53 -08:00
parent 7e2bd95fa5
commit 2dc170e25d
+2 -2
View File
@@ -4816,7 +4816,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, uint8_t *stateptr, const
switch (state) {
case 1: /* HTML/XML */
lc = '>';
if (is_xml && *(p -1) == '-') {
if (is_xml && p >= buf + 1 && *(p-1) == '-') {
break;
}
in_q = state = is_xml = 0;
@@ -4837,7 +4837,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, uint8_t *stateptr, const
break;
case 2: /* PHP */
if (!br && lc != '\"' && *(p-1) == '?') {
if (!br && lc != '\"' && p >= buf + 1 && *(p-1) == '?') {
in_q = state = 0;
tp = tbuf;
}