Skip to content

Commit 4e0134c

Browse files
committed
Fix bounds check in strip_tags()
1 parent adcdb4f commit 4e0134c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4822,7 +4822,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow,
48224822
* state == 2 (PHP). Switch back to HTML.
48234823
*/
48244824

4825-
if (state == 2 && p > buf+2 && strncasecmp(p-4, "<?xm", 4) == 0) {
4825+
if (state == 2 && p > buf+4 && strncasecmp(p-4, "<?xm", 4) == 0) {
48264826
state = 1; is_xml=1;
48274827
break;
48284828
}

0 commit comments

Comments
 (0)