Module: kamailio
Branch: 5.1
Commit: 5d738714cb95edbf119462553d16be547117355e
URL:
https://github.com/kamailio/kamailio/commit/5d738714cb95edbf119462553d16be5…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-12-30T18:41:57+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/5d738714cb95edbf119462553d16be5…
Patch:
https://github.com/kamailio/kamailio/commit/5d738714cb95edbf119462553d16be5…
---
diff --git a/src/main.c b/src/main.c
index dd33b89a75..f26aea8561 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1887,6 +1887,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",