Repository navigation
Conversation
php_xsl_apply_stylesheet() keeps the transformation's document reference in intern->doc and the callback node wrappers in the processor's node list, so a second transformation on the same processor, started from a php:function() callback or from main code while a Fiber is suspended inside one, freed that state under the running transformation. Throw an Error for such a call, as importStylesheet() already does, and restore transform_depth when a callback bails out so that the processor remains usable in shutdown functions.
Owner
Author
|
Submitted upstream as php#25355. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starting a second transformation on an XSLTProcessor that is already transforming, from a php:function() callback or from main code while a Fiber is suspended inside one, overwrote the processor's document reference and callback node list under the running transformation, which then read freed memory. Throw an Error for such a call, as importStylesheet() already does. A callback that bails out also no longer leaves the processor marked as transforming.
Found while reworking #461, which stacks on this. Red on master under ASAN (heap-use-after-free in dom_objects_free_storage), green patched; ext/xsl and ext/dom suites clean.