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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user