From 1a11c03a3822cf710ae8af5b5da358d0003d61d5 Mon Sep 17 00:00:00 2001 From: Bogdan-Andrei Iancu Date: Tue, 16 Jan 2024 17:15:52 +0200 Subject: [PATCH] Fix printing all values of branch(subfield) The [*] range was printing all the time the URI subfield of the branches, instead of the requested one. --- pvar.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvar.c b/pvar.c index 1f8511c2fce..5f4e67d71ac 100644 --- a/pvar.c +++ b/pvar.c @@ -2020,8 +2020,6 @@ static inline int get_branch_field( int idx, pv_name_t *pvn, pv_value_t *res) static int pv_get_branch_fields(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { - str uri; - qvalue_t q; int idx; int idxf; char *p; @@ -2048,10 +2046,12 @@ static int pv_get_branch_fields(struct sip_msg *msg, pv_param_t *param, p = pv_local_buf; idx = 0; - while ( (uri.s=get_branch(idx, &uri.len, &q, 0, 0, 0, 0))!=NULL ) { + while ( idxpvn, res); if ( pv_local_buf + PV_LOCAL_BUF_SIZE <= - p + uri.len + PV_FIELD_DELIM_LEN ) { + p + res->rs.len + PV_FIELD_DELIM_LEN ) { LM_ERR("local buffer length exceeded\n"); return pv_get_null(msg, param, res); } @@ -2061,8 +2061,8 @@ static int pv_get_branch_fields(struct sip_msg *msg, pv_param_t *param, p += PV_FIELD_DELIM_LEN; } - memcpy(p, uri.s, uri.len); - p += uri.len; + memcpy(p, res->rs.s, res->rs.len); + p += res->rs.len; idx++; }