mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
is_zend_ptr() expected zend_mm_heap.huge_list to be circular, but it's in fact NULL-terminated. It could crash when at least one huge block exists and the ptr did not belong to any block.
19 lines
338 B
PHP
19 lines
338 B
PHP
--TEST--
|
|
GH-14626: is_zend_ptr() may crash for non-zend ptrs when huge blocks exist
|
|
--EXTENSIONS--
|
|
zend_test
|
|
--FILE--
|
|
<?php
|
|
|
|
// Ensure there is at least one huge_block
|
|
$str = str_repeat('a', 2*1024*1024);
|
|
|
|
// Check that is_zend_ptr() does not crash
|
|
zend_test_is_zend_ptr(0);
|
|
zend_test_is_zend_ptr(1<<30);
|
|
|
|
?>
|
|
==DONE==
|
|
--EXPECT--
|
|
==DONE==
|