Module: kamailio
Branch: 5.2
Commit: aeaf35ce1f19dc46436102a2763a8e9a4d1db1b7
URL:
https://github.com/kamailio/kamailio/commit/aeaf35ce1f19dc46436102a2763a8e9…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-12-30T18:42:05+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/aeaf35ce1f19dc46436102a2763a8e9…
Patch:
https://github.com/kamailio/kamailio/commit/aeaf35ce1f19dc46436102a2763a8e9…
---
diff --git a/src/main.c b/src/main.c
index b7e9fdb58a..13c47a0852 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1889,6 +1889,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",