Skip to content

Fix is_zend_ptr() for huge blocks - #14626

Merged
arnaud-lb merged 4 commits into
php:PHP-8.2from
arnaud-lb:fix-is-zend-ptr
Jun 25, 2024
Merged

arnaud-lb merged 4 commits into
php:PHP-8.2from
arnaud-lb:fix-is-zend-ptr

Conversation

@arnaud-lb

@arnaud-lb arnaud-lb commented Jun 21, 2024 •

Copy link
Copy Markdown
Member

is_zend_ptr() expects zend_mm_heap.huge_list to be circular, but it's in fact NULL-terminated. It may crash when at least one huge block exists and the ptr does not belong to any block.

I've checked, and this mistake was not repeated in other places in zend_alloc.

zend_mm_heap.huge_list is NULL-terminated
@arnaud-lb
arnaud-lb marked this pull request as ready for review June 24, 2024 16:19

@dstogov dstogov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good

@dstogov

dstogov commented Jun 24, 2024

Copy link
Copy Markdown
Member

I think you may disable the failed FFI test for Windows.

@arnaud-lb
arnaud-lb merged commit 1ff277d into php:PHP-8.2 Jun 25, 2024
arnaud-lb added a commit that referenced this pull request Jun 25, 2024
arnaud-lb added a commit that referenced this pull request Jun 25, 2024
* PHP-8.2:
  [ci skip] NEWS for GH-14626
  Fix is_zend_ptr() for huge blocks (#14626)
arnaud-lb added a commit that referenced this pull request Jun 25, 2024
arnaud-lb added a commit that referenced this pull request Jun 25, 2024
* PHP-8.3:
  [ci skip] NEWS for GH-14626
  [ci skip] NEWS for GH-14626
  Fix is_zend_ptr() for huge blocks (#14626)
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.

2 participants