Skip to content

Commit

Permalink
AVP printing: Properly print NULL AVP fields
Browse files Browse the repository at this point in the history
AVPs such as ["foo", NULL, "bar"], which are only made possible by a few
select modules (e.g. Redis) were crashing in $(avp(foo)[*]).

(cherry picked from commit e66486f)
  • Loading branch information
liviuchircu committed May 20, 2019
1 parent 7fb724b commit 4a1390b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pvar.c
Expand Up @@ -2035,7 +2035,7 @@ static int pv_get_avp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
if(avp->flags & AVP_VAL_STR) {
res->rs = avp_value.s;
} else if(avp->flags & AVP_VAL_NULL) {
res->rs.s = NULL;
memset(&res->rs, 0, sizeof res->rs);
} else {
res->rs.s = sint2str(avp_value.n, &res->rs.len);
}
Expand All @@ -2054,7 +2054,7 @@ static int pv_get_avp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
if(avp->flags & AVP_VAL_STR) {
res->rs = avp_value.s;
} else if(avp->flags & AVP_VAL_NULL) {
res->rs.s = NULL;
memset(&res->rs, 0, sizeof res->rs);
} else {
res->rs.s = sint2str(avp_value.n, &res->rs.len);
}
Expand Down

0 comments on commit 4a1390b

Please sign in to comment.