Module: kamailio
Branch: master
Commit: f1194f44532f179c016269f93c44b755d2594c1d
URL:
https://github.com/kamailio/kamailio/commit/f1194f44532f179c016269f93c44b75…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-05-05T11:38:41+02:00
pv: check parameters and fix log message for invalid values for {s.fmtline...}
---
Modified: src/modules/pv/pv_trans.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f1194f44532f179c016269f93c44b75…
Patch:
https://github.com/kamailio/kamailio/commit/f1194f44532f179c016269f93c44b75…
---
diff --git a/src/modules/pv/pv_trans.c b/src/modules/pv/pv_trans.c
index 5f45fa8e66..a2b546d02a 100644
--- a/src/modules/pv/pv_trans.c
+++ b/src/modules/pv/pv_trans.c
@@ -1476,14 +1476,14 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int
subtype,
if(pv_get_spec_value(msg, (pv_spec_p)tp->next->v.data, &v)!=0
|| (!(v.flags&PV_VAL_INT)))
{
- LM_ERR("fmt cannot get p2 (cfg line: %d)\n",
+ LM_ERR("fmtline cannot get p2 (cfg line: %d)\n",
get_cfg_crt_line());
return -1;
}
m = v.ri;
}
- if(n<0 || m<0) {
- LM_ERR("substr negative offset (cfg line: %d)\n",
+ if(n<=0 || m<0) {
+ LM_ERR("fmtline with invalid parameters (cfg line: %d)\n",
get_cfg_crt_line());
return -1;
}