-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Segmentation fault in RecursiveIteratorIterator->current() with a xml element input #16808
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
Comments
It already goes wrong in non-JIT mode:
So the mixed type check for null isn't working properly apparently. But only for internal functions, userland functions seem fine... EDIT: actually on a release build it outputs "UNKNOWN:0" so that means an UNDEF value is produced somewhere and propagated... |
This is not a JIT nor opcache issue, the SXE iterator returns UNDEF when invalid (which is right EDIT: hmm or not will need to check) but SPL does not handle this right. Either it should check for validity first or check if the return value is UNDEF. |
Okay judging how the other code works: the issue is that SXE returns UNDEF but it should return NULL; that's how others do it too. So this is an SXE bug after all. |
…rent() with a xml element input When the current data is invalid, NULL must be returned. At least that's how the check in SPL works and how other extensions do this as well. If we don't do this, an UNDEF value gets propagated to a return value (misprinted as null); leading to issues.
* PHP-8.2: Fix GH-16808: Segmentation fault in RecursiveIteratorIterator->current() with a xml element input
Description
The following code:
Resulted in this output:
To reproduce: JIT 1015
PHP Version
nightly
Operating System
ubuntu 22.04
The text was updated successfully, but these errors were encountered: