Module: kamailio
Branch: 4.2
Commit: 7b2208dfb33e84e24ae33124218273cdd4ec1d5d
URL:
https://github.com/kamailio/kamailio/commit/7b2208dfb33e84e24ae33124218273c…
Author: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Committer: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Date: 2016-01-19T13:33:41+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/7b2208dfb33e84e24ae33124218273c…
Patch:
https://github.com/kamailio/kamailio/commit/7b2208dfb33e84e24ae33124218273c…
---
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;