Module: kamailio
Branch: 5.6
Commit: 2d7b6c32552b1e2a8b095192bb22e0f776e18100
URL:
https://github.com/kamailio/kamailio/commit/2d7b6c32552b1e2a8b095192bb22e0f…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2023-05-10T00:59:39+02:00
dialplan: fix ki_dp_translate() checks for input/output parameters
fixes #3447
(cherry picked from commit ab0a2be6b522c1b48a2442447c24e7ab156e3d4e)
(cherry picked from commit 5f3ed08b5e234465d4fb909460367a63ed63a550)
---
Modified: src/modules/dialplan/dialplan.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2d7b6c32552b1e2a8b095192bb22e0f…
Patch:
https://github.com/kamailio/kamailio/commit/2d7b6c32552b1e2a8b095192bb22e0f…
---
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;
}