Skip to content

Remote heap feng shui / heap spraying protection #14304

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Zend/tests/bug70258.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Bug #70258 (Segfault if do_resize fails to allocated memory)
--INI--
memory_limit=2M
memory_limit=4M
--SKIPIF--
<?php
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
Expand All @@ -25,4 +25,4 @@ $a = new A;
$a->core();
?>
--EXPECTF--
Fatal error: Allowed memory size of 2097152 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
Fatal error: Allowed memory size of 4194304 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/fibers/out-of-memory-in-fiber.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Out of Memory in a fiber
--INI--
memory_limit=2M
memory_limit=4M
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0") {
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/fibers/out-of-memory-in-nested-fiber.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Out of Memory in a nested fiber
--INI--
memory_limit=2M
memory_limit=4M
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0") {
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/fibers/out-of-memory-in-recursive-fiber.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Out of Memory from recursive fiber creation
--INI--
memory_limit=2M
memory_limit=4M
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0") {
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/gh11189.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GH-11189: Exceeding memory limit in zend_hash_do_resize leaves the array in an i
if (getenv("USE_ZEND_ALLOC") === "0") die("skip ZMM is disabled");
?>
--INI--
memory_limit=2M
memory_limit=4M
--FILE--
<?php

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/gh11189_1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GH-11189: Exceeding memory limit in zend_hash_do_resize leaves the array in an i
if (getenv("USE_ZEND_ALLOC") === "0") die("skip ZMM is disabled");
?>
--INI--
memory_limit=2M
memory_limit=4M
--FILE--
<?php

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/gh12073.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function test() {
};
}

ini_set('memory_limit', '2M');
ini_set('memory_limit', '4M');

$array = [];
for ($i = 0; $i < 10_000; $i++) {
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/new_oom.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$mb_used = (int) ceil(memory_get_usage() / (1024 ** 2));
$mb_used = (int) ceil(memory_get_usage(true) / (1024 ** 2));
ini_set('memory_limit', ($mb_used + 1) . 'M');

$class = $argv[1];
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/object_gc_in_shutdown.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Bug object gc not working in shutdown
--FILE--
<?php
ini_set('memory_limit', '2M');
ini_set('memory_limit', '4M');
register_shutdown_function(function () {
for ($n = 1000 * 1000; $n--;) {
for ($n = 2 * 1000 * 1000; $n--;) {
new stdClass;
}
echo "OK\n";
Expand Down
Loading
Loading