Module: kamailio
Branch: master
Commit: a86fa8f9c9d2a9f63732b43b1087e6cc5cba18fb
URL:
https://github.com/kamailio/kamailio/commit/a86fa8f9c9d2a9f63732b43b1087e6c…
Author: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Committer: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Date: 2016-01-19T11:09:59+02:00
carrierroute: fixed possible kamctl fifo segfault
- introduced checks to reject contiguous -{OPTION}{PARAMETER} in kamctl fifo commands
e.g.: kamctl fifo cr_activate_host "-dproxy -p 49 -h proxy1" is not allowed
---
Modified: modules/carrierroute/cr_fifo.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a86fa8f9c9d2a9f63732b43b1087e6c…
Patch:
https://github.com/kamailio/kamailio/commit/a86fa8f9c9d2a9f63732b43b1087e6c…
---
diff --git a/modules/carrierroute/cr_fifo.c b/modules/carrierroute/cr_fifo.c
index 0455ba8..6cb6e55 100644
--- a/modules/carrierroute/cr_fifo.c
+++ b/modules/carrierroute/cr_fifo.c
@@ -490,7 +490,15 @@ static int get_fifo_opts(str * buf, fifo_opt_t * opts, unsigned int
opt_set[]) {
LM_DBG("token %.*s", opt_argv[i].len, opt_argv[i].s);
if (opt_argv[i].len >= 1) {
switch(*opt_argv[i].s) {
- case '-': switch(opt_argv[i].s[1]) {
+ case '-':
+ /* -{OPTION}{PARAMETER} is not allowed */
+ if (opt_argv[i].len != 2) {
+ FIFO_ERR(E_WRONGOPT);
+ LM_DBG("Unknown option:
%.*s\n", opt_argv[i].len, opt_argv[i].s);
+ return -1;
+ }
+
+ switch(opt_argv[i].s[1]) {
case OPT_DOMAIN_CHR:
op = OPT_DOMAIN;
used_opts |= O_DOMAIN;