Skip to content

Commit

Permalink
mid_registrar: Properly initialize the "received_avp"
Browse files Browse the repository at this point in the history
This bug was caused by an incomplete backport, in commit 1c0ea02.

Reported by Sebastian Sastre on the users mailing list.
  • Loading branch information
liviuchircu committed Mar 20, 2018
1 parent 18c63e7 commit 3a66b9c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions modules/mid_registrar/mid_registrar.c
Expand Up @@ -269,6 +269,9 @@ static int registrar_fixup(void** param, int param_no)

static int mod_init(void)
{
str s;
pv_spec_t avp_spec;

if (load_ul_api(&ul_api) < 0) {
LM_ERR("failed to load user location API\n");
return -1;
Expand Down Expand Up @@ -333,6 +336,24 @@ static int mod_init(void)
*/
reg_use_domain = ul_api.use_domain;

if (rcv_avp_param && *rcv_avp_param) {
s.s = rcv_avp_param; s.len = strlen(s.s);
if (pv_parse_spec(&s, &avp_spec)==0
|| avp_spec.type!=PVT_AVP) {
LM_ERR("malformed or non AVP %s AVP definition\n", rcv_avp_param);
return -1;
}

if(pv_get_avp_name(0, &avp_spec.pvp, &rcv_avp_name, &rcv_avp_type)!=0)
{
LM_ERR("[%s]- invalid AVP definition\n", rcv_avp_param);
return -1;
}
} else {
rcv_avp_name = -1;
rcv_avp_type = 0;
}

rcv_param.len = strlen(rcv_param.s);

realm_prefix.s = realm_pref;
Expand Down

0 comments on commit 3a66b9c

Please sign in to comment.