From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Fri, 27 May 2022 17:18:01 +0200
Subject: [PATCH] dialog: w_dlg_get_var, fix incompatible pointer

> CC (gcc) [M dialog.so]          dialog.o
> dialog.c: In function 'w_dlg_get_var': dialog.c:1608:6: warning: assignment to 'str *' {aka 'struct _str *'} from incompatible pointer type 'sr_kemi_xval_t *' {aka 'struct sr_kemi_xval *'} [-Wincompatible-pointer-types]
> 1608 |  val = ki_dlg_get_var(msg, &sc, &sf, &st, &k);
>      |      ^
---
 src/modules/dialog/dialog.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 61bf03b..6545444 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -1571,7 +1571,7 @@ static int w_dlg_get_var(struct sip_msg *msg, char *ci, char *ft, char *tt, char
 	str sf = STR_NULL;
 	str st = STR_NULL;
 	str k = STR_NULL;
-	str *val = NULL;
+	sr_kemi_xval_t *val = NULL;
 	pv_value_t dst_val;
 	pv_spec_t* dst_pv = (pv_spec_t *)pv;
 
@@ -1609,11 +1609,11 @@ static int w_dlg_get_var(struct sip_msg *msg, char *ci, char *ft, char *tt, char
 		goto error;
 	}
 	val = ki_dlg_get_var(msg, &sc, &sf, &st, &k);
-	if(val) {
+	if(val && val->vtype == SR_KEMIP_STR) {
 		memset(&dst_val, 0, sizeof(pv_value_t));
 		dst_val.flags |= PV_VAL_STR;
-		dst_val.rs.s = val->s;
-		dst_val.rs.len = val->len;
+		dst_val.rs.s = val->v.s.s;
+		dst_val.rs.len = val->v.s.len;
 	} else {
 		pv_get_null(msg, NULL, &dst_val);
 	}
