From a2522abe55266c26dbf23e45c3c10b46eee58a01 Mon Sep 17 00:00:00 2001 From: Roman Marynchak Date: Fri, 18 Feb 2011 20:59:08 +0000 Subject: [PATCH] Check that dynamic-space-size option is a positive number --- src/runtime/runtime.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index 0f1f0ff..b853b14 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -397,6 +397,8 @@ main(int argc, char *argv[], char *envp[]) dynamic_space_size = strtol(argv[argi++], 0, 0) << 20; if (errno) lose("argument to --dynamic-space-size is not a number"); + if (0 >= (int)dynamic_space_size) + lose("--dynamic-space-size must be a positive number"); # ifdef MAX_DYNAMIC_SPACE_END if (!((DYNAMIC_SPACE_START < DYNAMIC_SPACE_START+dynamic_space_size) && -- 1.7.4