fixed uaf and warnings

This commit is contained in:
Dominik Maier
2020-04-13 16:57:19 +02:00
parent dda096da03
commit 326ab632c3
12 changed files with 34 additions and 24 deletions

View File

@ -902,6 +902,12 @@ int main(int argc, char **argv, char **envp) {
if (mem_limit_given) FATAL("Multiple -m options not supported");
mem_limit_given = 1;
if (!optarg) {
FATAL("Bad syntax used for -m");
}
if (!strcmp(optarg, "none")) {
mem_limit = 0;
@ -938,6 +944,8 @@ int main(int argc, char **argv, char **envp) {
if (timeout_given) FATAL("Multiple -t options not supported");
timeout_given = 1;
if (!optarg) FATAL("Wrong usage of -t");
exec_tmout = atoi(optarg);
if (exec_tmout < 10 || optarg[0] == '-')