summaryrefslogtreecommitdiff
path: root/tests/executor/memory_limit_negative.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/executor/memory_limit_negative.phpt')
-rw-r--r--tests/executor/memory_limit_negative.phpt18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/executor/memory_limit_negative.phpt b/tests/executor/memory_limit_negative.phpt
new file mode 100644
index 0000000..7fad546
--- /dev/null
+++ b/tests/executor/memory_limit_negative.phpt
@@ -0,0 +1,18 @@
1--TEST--
2memory_limit test: trying to set memory_limit to a negative value
3--SKIPIF--
4<?php if (!function_exists("memory_get_usage")) print "skip PHP not compiled with memory_limit support"; ?>
5--INI--
6memory_limit=16M
7suhosin.memory_limit=17M
8suhosin.log.syslog=0
9suhosin.log.script=0
10suhosin.log.sapi=2
11--FILE--
12<?php
13 ini_set("memory_limit", "-200000"); echo ini_get("memory_limit"), "\n";
14?>
15--EXPECTF--
16ALERT - script tried to disable memory_limit by setting it to a negative value -%d bytes which is not allowed (attacker 'REMOTE_ADDR not set', file '%s', line 2)
1716M
18