Skip to content

Commit

Permalink
Fix fallback after another fallback.
Browse files Browse the repository at this point in the history
Avoid decrementing the prefix len if already 0.
  • Loading branch information
bogdan-iancu committed Jan 5, 2017
1 parent 59d10ef commit 54438e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/drouting/drouting.c
Expand Up @@ -3085,7 +3085,7 @@ static int do_routing(struct sip_msg* msg, dr_part_group_t * part_group,
void *data;
/* all rules under current prefix used -> reduce the prefix */
data = (void*)&avp_prefix->data;
((str*)data)->len = prefix_len-1;
((str*)data)->len = prefix_len?prefix_len-1:0;
}
LM_DBG("updating to %d, prefix %.*s \n",rule_idx,
prefix_len-(rule_idx?1:0),username.s);
Expand Down

0 comments on commit 54438e4

Please sign in to comment.