summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/config.py b/config.py
index b344631..81bd7d1 100644
--- a/config.py
+++ b/config.py
@@ -393,6 +393,9 @@ def _augment_sys_argv_from_loadfile():
newargs = [
arg.strip('\n') for arg in contents.split('\n') if 'config_savefile' not in arg
]
+ size = sys.getsizeof(newargs)
+ if size > 1024 * 1024:
+ raise Exception(f'Saved args are too large! ({size} bytes)')
except Exception as e:
raise Exception(f'Error reading {zkpath} from zookeeper.') from e
SAVED_MESSAGES.append(f'Loaded config from zookeeper from {zkpath}')