Module: kamailio
Branch: 5.0
Commit: ccf6bfe19e9402e616633c9b18fef0a08c27d304
URL:
https://github.com/kamailio/kamailio/commit/ccf6bfe19e9402e616633c9b18fef0a…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2019-01-11T16:11:43+01:00
core: check for optarg before passing it to external library (coverity report)
(cherry picked from commit 7eb1eae615a4c3ef710e9931b101ddc4db07aff2)
---
Modified: src/main.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ccf6bfe19e9402e616633c9b18fef0a…
Patch:
https://github.com/kamailio/kamailio/commit/ccf6bfe19e9402e616633c9b18fef0a…
---
diff --git a/src/main.c b/src/main.c
index 8982c31c8e..1e8859ab65 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1891,6 +1891,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",