Module: kamailio
Branch: master
Commit: a0d89214cf8296d30bacdf10a8732bc8826b2418
URL:
https://github.com/kamailio/kamailio/commit/a0d89214cf8296d30bacdf10a8732bc…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-05-27T17:18:01+02:00
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);
| ^
---
Modified: src/modules/dialog/dialog.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a0d89214cf8296d30bacdf10a8732bc…
Patch:
https://github.com/kamailio/kamailio/commit/a0d89214cf8296d30bacdf10a8732bc…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 767e6efa54..2082a41e19 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -1568,7 +1568,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;
@@ -1606,11 +1606,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);
}