Module: kamailio
Branch: master
Commit: b411303502282b2f4d32ad299ed5bcfd0852e902
URL:
https://github.com/kamailio/kamailio/commit/b411303502282b2f4d32ad299ed5bcf…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-10-19T18:31:18+02:00
pv: check for contact address in pv_get_hfl()
---
Modified: src/modules/pv/pv_core.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b411303502282b2f4d32ad299ed5bcf…
Patch:
https://github.com/kamailio/kamailio/commit/b411303502282b2f4d32ad299ed5bcf…
---
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 27966dbdcd1..903389bf593 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -2449,11 +2449,16 @@ int pv_get_hfl(sip_msg_t *msg, pv_param_t *param, pv_value_t
*res)
}
if(idx==0) {
cb = ((contact_body_t*)msg->contact->parsed)->contacts;
- sval.s = cb->name.s;
- sval.len = cb->len;
- trim(&sval);
- res->rs = sval;
- return 0;
+ if(cb!=NULL) {
+ sval.s = cb->name.s;
+ sval.len = cb->len;
+ trim(&sval);
+ res->rs = sval;
+ return 0;
+ } else {
+ LM_DBG("no contact addresses\n");
+ return pv_get_null(msg, param, res);
+ }
}
n=0;
for(hf=msg->contact; hf!=NULL; hf=hf->next) {