Skip to content

Fix segfault comparing uninitialized SimpleXMLElement instances - #214

Closed
iliaal wants to merge 6 commits into
PHP-8.4from
fix/sxe-compare-uninitialized
Closed

Fix segfault comparing uninitialized SimpleXMLElement instances#214
iliaal wants to merge 6 commits into
PHP-8.4from
fix/sxe-compare-uninitialized

Conversation

@iliaal

@iliaal iliaal commented Aug 5, 2026

Copy link
Copy Markdown
Owner

sxe_objects_compare dereferenced document->ptr when both nodes were NULL without checking document. A SimpleXMLElement subclass that skips parent __construct leaves document NULL, so $a == $b segfaulted. Treat two NULL documents as equal.

shivammathur and others added 5 commits August 5, 2026 12:27
* PHP-8.2:
  Fix hMailServer URL in Windows CI (php#23055)
* PHP-8.3:
  Fix hMailServer URL in Windows CI (php#23055)
The id must be reset to NULL before calling code that can invoke
userland code, as the id remains visible after release due to a stale
pointer.

Closes phpGH-23046.
@iliaal
iliaal force-pushed the fix/sxe-compare-uninitialized branch from a6fdaf7 to 6701e73 Compare August 5, 2026 13:27
sxe_objects_compare dereferenced document->ptr when both nodes were
NULL without checking document. A subclass that skips parent
__construct leaves document NULL, so $a == $b segfaulted. Treat two
NULL documents as equal and mixed NULL/non-NULL as uncomparable.

Closes phpGH-23067
@iliaal
iliaal force-pushed the fix/sxe-compare-uninitialized branch from 6701e73 to 0094ebf Compare August 5, 2026 13:28
@iliaal

iliaal commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Promoted upstream as php#23067.

@iliaal iliaal closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants