summaryrefslogtreecommitdiff
path: root/memory_limit.c
diff options
context:
space:
mode:
authorStefan Esser2012-01-11 19:57:40 +0100
committerStefan Esser2012-01-11 19:57:40 +0100
commit70310b8f359e1276e3fa6ed326a8f91d9b02f0fc (patch)
tree47d25d6c801d7417e4e65a15778a42cf5204b1f6 /memory_limit.c
parentba38594769bc6d4bf3dbb6ab8a666a165a77b8b4 (diff)
Fix git repository. Github had the wrong git repository commited. The last revisions were missing.
From here we can continue developing.
Diffstat (limited to 'memory_limit.c')
-rw-r--r--memory_limit.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/memory_limit.c b/memory_limit.c
index 84c0bf3..c135ab4 100644
--- a/memory_limit.c
+++ b/memory_limit.c
@@ -47,12 +47,20 @@ static PHP_INI_MH(suhosin_OnChangeMemoryLimit)
47 SUHOSIN_G(hard_memory_limit) = 0; 47 SUHOSIN_G(hard_memory_limit) = 0;
48 } 48 }
49 if (new_value) { 49 if (new_value) {
50 PG(memory_limit) = zend_atoi(new_value, new_value_length); 50 PG(memory_limit) = zend_atol(new_value, new_value_length);
51 if (PG(memory_limit) > hard_memory_limit || PG(memory_limit) < 0) { 51 if (hard_memory_limit > 0) {
52 suhosin_log(S_MISC, "script tried to increase memory_limit to %u bytes which is above the allowed value", PG(memory_limit)); 52 if (PG(memory_limit) > hard_memory_limit) {
53 if (!SUHOSIN_G(simulation)) { 53 suhosin_log(S_MISC, "script tried to increase memory_limit to %u bytes which is above the allowed value", PG(memory_limit));
54 PG(memory_limit) = hard_memory_limit; 54 if (!SUHOSIN_G(simulation)) {
55 return FAILURE; 55 PG(memory_limit) = hard_memory_limit;
56 return FAILURE;
57 }
58 } else if (PG(memory_limit) < 0) {
59 suhosin_log(S_MISC, "script tried to disable memory_limit by setting it to a negative value %d bytes which is not allowed", PG(memory_limit));
60 if (!SUHOSIN_G(simulation)) {
61 PG(memory_limit) = hard_memory_limit;
62 return FAILURE;
63 }
56 } 64 }
57 } 65 }
58 } else { 66 } else {