Skip to content

Commit

Permalink
pv: check for contact address in pv_get_hfl()
Browse files Browse the repository at this point in the history
(cherry picked from commit b411303)
  • Loading branch information
miconda committed Jan 6, 2023
1 parent f625473 commit b78a813
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/modules/pv/pv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b78a813

Please sign in to comment.