Skip to content

Commit

Permalink
modules/siputils: do not let $pcv(value) to contain invalid value
Browse files Browse the repository at this point in the history
  • Loading branch information
mslehto committed Nov 6, 2016
1 parent 8d57053 commit eecc0a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/siputils/chargingvector.c
Expand Up @@ -172,6 +172,7 @@ static int sip_parse_charging_vector(const char * pcv_value, unsigned int len)
}
else
{
LM_WARN("mandatory icid-value not found\n");
pcv_id.s = NULL;
pcv_id.len = 0;
}
Expand All @@ -186,16 +187,15 @@ static int sip_parse_charging_vector(const char * pcv_value, unsigned int len)
}
else
{
LM_DBG("icid-generated-at not found\n");
pcv_host.s = NULL;
pcv_host.len = 0;
}

// Buggy charging vector where only icid-value is sent ...
if ( pcv_host.s == NULL && pcv_id.s == NULL && len > 0)
// only icid-value is mandatory, log anyway when missing icid-generated-at
if ( pcv_host.s == NULL && pcv_id.s != NULL && len > 0)
{
pcv_id.s = (char *) pcv_value,
pcv_id.len = sip_param_end(pcv_id.s, len);
LM_WARN("parsed BUGGY P-Charging-Vector %.*s\n", pcv_id.len, pcv_id.s );
LM_WARN("icid-generated-at is missing %.*s\n", len, pcv_value);
}

return (pcv_id.s != NULL);
Expand Down

0 comments on commit eecc0a1

Please sign in to comment.