Module: kamailio
Branch: master
Commit: ae22ba7eb41259f9def7e1e0e30b755214e26234
URL:
https://github.com/kamailio/kamailio/commit/ae22ba7eb41259f9def7e1e0e30b755…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-04T11:27:08+02:00
core: msg translator - skip last ; from xavp serialized in via params
---
Modified: src/core/msg_translator.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ae22ba7eb41259f9def7e1e0e30b755…
Patch:
https://github.com/kamailio/kamailio/commit/ae22ba7eb41259f9def7e1e0e30b755…
---
diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c
index 2e649ac6c6..88019b869b 100644
--- a/src/core/msg_translator.c
+++ b/src/core/msg_translator.c
@@ -2945,7 +2945,7 @@ char* create_via_hf( unsigned int *len,
xparams.len = xavp_serialize_fields(&_ksr_xavp_via_params,
xparams.s, pv_get_buffer_size());
if(xparams.len>0) {
- via = (char*)pkg_malloc(extra_params.len+xparams.len+1);
+ via = (char*)pkg_malloc(extra_params.len+xparams.len+2);
if(via==0) {
LM_ERR("building xavps params failed\n");
if (extra_params.s) pkg_free(extra_params.s);
@@ -2955,7 +2955,10 @@ char* create_via_hf( unsigned int *len,
memcpy(via, extra_params.s, extra_params.len);
pkg_free(extra_params.s);
}
- memcpy(via + extra_params.len, xparams.s, xparams.len);
+ /* add ';' between via parameters */
+ via[extra_params.len] = ';';
+ /* skip last ';' from xavp serialized output */
+ memcpy(via + extra_params.len + 1, xparams.s, xparams.len - 1);
extra_params.s = via;
extra_params.len += xparams.len;
extra_params.s[extra_params.len] = '\0';