Browse Source

dialplan: fix ki_dp_translate() checks for input/output parameters

fixes #3447

(cherry picked from commit ab0a2be6b522c1b48a2442447c24e7ab156e3d4e)
Victor Seva 2 years ago
parent
commit
5f3ed08b5e
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/modules/dialplan/dialplan.c

+ 6 - 3
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;
 	}