summaryrefslogtreecommitdiff
path: root/mesecons/settings.lua
diff options
context:
space:
mode:
authorJeija <jeija@mesecons.net>2014-06-01 10:57:58 +0200
committerJeija <jeija@mesecons.net>2014-06-01 11:00:39 +0200
commite5896076fe35f335794c0136cb12768109ad6fea (patch)
treebc4f4f059a0c07628929a439dc3875a1c2c6f990 /mesecons/settings.lua
parentb64fea4f707547c4b84ae54e204ac51255ae476f (diff)
downloadmesecons-e5896076fe35f335794c0136cb12768109ad6fea.tar
mesecons-e5896076fe35f335794c0136cb12768109ad6fea.tar.gz
mesecons-e5896076fe35f335794c0136cb12768109ad6fea.tar.bz2
mesecons-e5896076fe35f335794c0136cb12768109ad6fea.tar.xz
mesecons-e5896076fe35f335794c0136cb12768109ad6fea.zip
Make sure #160 cannot be exploited to make servers crash.
This is not exactly a fix for the issue, because extremely large circuits (3000+ conductors) still won't work with this applied. This simply aborts any execution if there is the danger of a stack overflow.
Diffstat (limited to 'mesecons/settings.lua')
-rw-r--r--mesecons/settings.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesecons/settings.lua b/mesecons/settings.lua
index 160df67..eb34f17 100644
--- a/mesecons/settings.lua
+++ b/mesecons/settings.lua
@@ -10,3 +10,5 @@ MESECONS_RESUMETIME = 4 -- time to wait when starting the server before
OVERHEAT_MAX = 20 -- maximum heat of any component that directly sends an output
-- signal when the input changes (e.g. luacontroller, gates)
-- Unit: actions per second, checks are every 1 second
+STACK_SIZE = 3000 -- Recursive functions will abort when this is reached. Therefore,
+ -- this is also limits the maximum circuit size.