Skip to content

Commit

Permalink
Complete commit bb1fcc2
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Dec 21, 2021
1 parent 29ee932 commit 9e2e817
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pvar.c
Expand Up @@ -365,19 +365,19 @@ static int pv_get_route_name(struct sip_msg *msg, pv_param_t *param,

} else {
s = str_route;
if (!route_stack[idx])
if (!route_stack[route_stack_start + idx])
goto out_ok;
}

len = strlen(route_stack[idx]);
len = strlen(route_stack[route_stack_start + idx]);

if (route_stack[idx][0] != '!') {
if (route_stack[route_stack_start + idx][0] != '!') {
if (pkg_str_extend(&rn_buf, s.len + 2 + len + 1) != 0) {
LM_ERR("oom\n");
return pv_get_null(msg, param, res);
}

s.len = sprintf(rn_buf.s, "%.*s[%s]", s.len, s.s, route_stack[idx]);
s.len = sprintf(rn_buf.s, "%.*s[%s]", s.len, s.s, route_stack[route_stack_start + idx]);
s.s = rn_buf.s;
} else {
/* the "!" marker tells us to print that route name as-is */
Expand All @@ -386,7 +386,7 @@ static int pv_get_route_name(struct sip_msg *msg, pv_param_t *param,
return pv_get_null(msg, param, res);
}

s.len = sprintf(rn_buf.s, "%s", route_stack[idx] + 1);
s.len = sprintf(rn_buf.s, "%s", route_stack[route_stack_start + idx] + 1);
s.s = rn_buf.s;
}

Expand Down

0 comments on commit 9e2e817

Please sign in to comment.