Skip to content

Fix GH-15654: Signed integer overflow in ext/dom/nodelist.c #15669

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

There's implicit truncation casts from zend_long to int which cause issues because checks are done against the zend_longs. Since the iterator infrastructure uses zend_longs, just convert everything to zend_long.

Technically, there's a behaviour bug that this will also cause on PHP 8.2, but let's not risk anything as people are unlikely to hit that anyway (they'd need more than 2**32 child nodes).

There's implicit truncation casts from zend_long to int which cause
issues because checks are done against the zend_longs. Since the
iterator infrastructure uses zend_longs, just convert everything to
zend_long.
@nielsdos nielsdos linked an issue Aug 30, 2024 that may be closed by this pull request
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.

lctm

@nielsdos nielsdos closed this in 9cb23a3 Aug 31, 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.

Signed integer overflow in ext/dom/nodelist.c
2 participants