Module: kamailio
Branch: master
Commit: ab0a2be6b522c1b48a2442447c24e7ab156e3d4e
URL:
https://github.com/kamailio/kamailio/commit/ab0a2be6b522c1b48a2442447c24e7a…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2023-05-09T23:28:04+02:00
dialplan: fix ki_dp_translate() checks for input/output parameters
fixes #3447
---
Modified: src/modules/dialplan/dialplan.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ab0a2be6b522c1b48a2442447c24e7a…
Patch:
https://github.com/kamailio/kamailio/commit/ab0a2be6b522c1b48a2442447c24e7a…
---
diff --git a/src/modules/dialplan/dialplan.c b/src/modules/dialplan/dialplan.c
index fb57faa55d1..26c68f777fd 100644
--- a/src/modules/dialplan/dialplan.c
+++ b/src/modules/dialplan/dialplan.c
@@ -872,9 +872,12 @@ static int ki_dp_translate(sip_msg_t* msg, int id, str *input_spv,
str *output_s
if (!msg)
return -1;
- if (input_spv == NULL || input_spv->s == NULL || input_spv->len <= 0 ||
- output_spv == NULL || output_spv->s == NULL || output_spv->len <= 0) {
- LM_ERR("invalid destination var name for input or output\n");
+ if (input_spv != NULL && (input_spv->s == NULL || input_spv->len <= 0))
{
+ LM_ERR("invalid destination var name for input\n");
+ return -1;
+ }
+ if (output_spv != NULL && (output_spv->s == NULL || output_spv->len <=
0)) {
+ LM_ERR("invalid destination var name for output\n");
return -1;
}