Skip to content

Fix GH-16292: Segmentation fault in ext/xmlreader/php_xmlreader.c:1282 #16307

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

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Oct 8, 2024

3 issues:

  1. RETURN_NULL() was used via the macro NODE_GET_OBJ(), but the function
    returns false on failure and cannot return null according to its
    stub.
  2. The struct layout of the different implementors of libxml only
    guarantees overlap between the node pointer and the document
    reference, so accessing the std zend_object may not work.
  3. DOC_GET_OBJ() wasn't using ZSTR_VAL().

Note to self: update the condition in php_xmlreader.c upon merging up.

…1282

3 issues:
1) RETURN_NULL() was used via the macro NODE_GET_OBJ(), but the function
   returns false on failure and cannot return null according to its
   stub.
2) The struct layout of the different implementors of libxml only
   guarantees overlap between the node pointer and the document
   reference, so accessing the std zend_object may not work.
3) DOC_GET_OBJ() wasn't using ZSTR_VAL().
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nielsdos
Copy link
Member Author

nielsdos commented Oct 8, 2024

The public header is indeed touched, but ABI compatibility is kept.

@nielsdos nielsdos removed the ABI break label Oct 8, 2024
@nielsdos nielsdos closed this in 5c12493 Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault in ext/xmlreader/php_xmlreader.c:1282
2 participants