Module: kamailio
Branch: master
Commit: 9db18bc48bff0d230e66973a45c8e72e1b7744e8
URL:
https://github.com/kamailio/kamailio/commit/9db18bc48bff0d230e66973a45c8e72…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-11T10:07:39+01:00
dialog: check first the size
---
Modified: src/modules/dialog/dlg_var.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9db18bc48bff0d230e66973a45c8e72…
Patch:
https://github.com/kamailio/kamailio/commit/9db18bc48bff0d230e66973a45c8e72…
---
diff --git a/src/modules/dialog/dlg_var.c b/src/modules/dialog/dlg_var.c
index 10df9e90c3e..db5f61c4e05 100644
--- a/src/modules/dialog/dlg_var.c
+++ b/src/modules/dialog/dlg_var.c
@@ -667,8 +667,8 @@ int pv_set_dlg_ctx(
break;
case 4:
if(val && val->flags & PV_VAL_STR) {
- if(val->rs.s[val->rs.len] == '\0'
- && val->rs.len < DLG_TOROUTE_SIZE) {
+ if(val->rs.len < DLG_TOROUTE_SIZE
+ && val->rs.s[val->rs.len] == '\0') {
_dlg_ctx.to_route = route_lookup(&main_rt, val->rs.s);
strcpy(_dlg_ctx.to_route_name, val->rs.s);
} else {