Module: kamailio
Branch: master
Commit: 7eb1eae615a4c3ef710e9931b101ddc4db07aff2
URL:
https://github.com/kamailio/kamailio/commit/7eb1eae615a4c3ef710e9931b101ddc…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-12-30T00:52:18+01:00
core: check for optarg before passing it to external library (coverity report)
---
Modified: src/main.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7eb1eae615a4c3ef710e9931b101ddc…
Patch:
https://github.com/kamailio/kamailio/commit/7eb1eae615a4c3ef710e9931b101ddc…
---
diff --git a/src/main.c b/src/main.c
index ac58b760ba..be1405eeec 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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",