-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML Api: Fix out of bounds string access #5793
HTML Api: Fix out of bounds string access #5793
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
6145140
to
69a7965
Compare
@sirreal I've cherry-picked my rebuilt change in 9e7167a onto #5725. If you want we can re-target this PR against that branch or close it out. I'm worried about losing the change in the stacked PRs if we merge it first, but if you prefer that we can do that and I'll rebuild avoid-parsing-incomplete-tokens on top of it. |
Committed to Core as part of https://core.trac.wordpress.org/changeset/57211 (see #5793 (comment)). |
Trac ticket: https://core.trac.wordpress.org/ticket/60108
The HTML API Tag Processor may attempt to perform out of range string index access, which may manifest as:
This PR also reuses a
$doc_length
variable. There's astrlen( $html )
performed at the top of the function and the result can be reused instead of callingstrlen
repeatedly.This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.