Skip to content

Commit

Permalink
core: check for optarg before passing it to external library (coverit…
Browse files Browse the repository at this point in the history
…y report)
  • Loading branch information
henningw committed Dec 29, 2018
1 parent 967a716 commit 7eb1eae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.c
Expand Up @@ -1908,6 +1908,10 @@ int main(int argc, char** argv)
log_color=1;
break;
case 'M':
if (optarg == NULL) {
fprintf(stderr, "bad private mem size\n");
goto error;
}
pkg_mem_size=strtol(optarg, &tmp, 10) * 1024 * 1024;
if (tmp &&(*tmp)){
fprintf(stderr, "bad private mem size number: -M %s\n",
Expand Down

0 comments on commit 7eb1eae

Please sign in to comment.