Module: kamailio
Branch: master
Commit: 82b0f273e1cf65051b6c50301c5073dce56c1149
URL:
https://github.com/kamailio/kamailio/commit/82b0f273e1cf65051b6c50301c5073d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-09-07T14:16:49+02:00
core: parser - set via->params.len when body is finished
---
Modified: src/core/parser/parse_via.c
---
Diff:
https://github.com/kamailio/kamailio/commit/82b0f273e1cf65051b6c50301c5073d…
Patch:
https://github.com/kamailio/kamailio/commit/82b0f273e1cf65051b6c50301c5073d…
---
diff --git a/src/core/parser/parse_via.c b/src/core/parser/parse_via.c
index 921911f1d17..a978d1aaf2e 100644
--- a/src/core/parser/parse_via.c
+++ b/src/core/parser/parse_via.c
@@ -2692,6 +2692,17 @@ char *parse_via(
goto error;
}
}
+ if(vb->params.s != NULL && vb->params.len == 0 &&
vb->last_param != NULL) {
+ if(vb->last_param->name.len > 0) {
+ if(vb->last_param->value.len > 0) {
+ vb->params.len = vb->last_param->value.s + vb->last_param->value.len
+ - vb->params.s;
+ } else {
+ vb->params.len = vb->last_param->name.s + vb->last_param->name.len
+ - vb->params.s;
+ }
+ }
+ }
return tmp;
nextvia:
DBG("parsing via: next via\n");
@@ -2706,6 +2717,18 @@ char *parse_via(
goto error;
}
}
+ if(vb->params.s != NULL && vb->params.len == 0 &&
vb->last_param != NULL) {
+ if(vb->last_param->name.len > 0) {
+ if(vb->last_param->value.len > 0) {
+ vb->params.len = vb->last_param->value.s + vb->last_param->value.len
+ - vb->params.s;
+ } else {
+ vb->params.len = vb->last_param->name.s + vb->last_param->name.len
+ - vb->params.s;
+ }
+ }
+ }
+
vb->next = pkg_malloc(sizeof(struct via_body));
if(vb->next == 0) {
PKG_MEM_ERROR;