diff --git a/common/options.cpp b/common/options.cpp index d909ac9bb0..b072a06d28 100644 --- a/common/options.cpp +++ b/common/options.cpp @@ -274,7 +274,7 @@ int convert_bytes_num_to_string(long long bytes, char *res, int res_size) { } int parse_time_limit(const char *s) { - int x; + int x = 0; char c = 0; if (sscanf(s, "%d%c", &x, &c) < 1) { kprintf ("Parsing time limit for option fail: %s\n", s); diff --git a/server/php-engine.cpp b/server/php-engine.cpp index 3eaffff611..6a53a9ec6d 100644 --- a/server/php-engine.cpp +++ b/server/php-engine.cpp @@ -1840,7 +1840,11 @@ int main_args_handler(int i, const char *long_option) { } case 'm': { max_memory = parse_memory_limit_default(optarg, 'm'); - assert((1 << 20) <= max_memory && max_memory <= (2047LL << 20)); + const long long min_size = 1 << 20; + if (max_memory <= min_size) { + kprintf("--%s option: cannot be less than 1 megabyte\n", long_option); + return -1; + } return 0; } case 'f': {