Module: kamailio
Branch: master
Commit: a7571233bc7dee0381e8ed7e44408f63fa45c156
URL:
https://github.com/kamailio/kamailio/commit/a7571233bc7dee0381e8ed7e44408f6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-09-26T11:46:59+02:00
dialog: update check on dialog var key length
---
Modified: src/modules/dialog/dlg_var.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a7571233bc7dee0381e8ed7e44408f6…
Patch:
https://github.com/kamailio/kamailio/commit/a7571233bc7dee0381e8ed7e44408f6…
---
diff --git a/src/modules/dialog/dlg_var.c b/src/modules/dialog/dlg_var.c
index 04a645309b..0a16d18296 100644
--- a/src/modules/dialog/dlg_var.c
+++ b/src/modules/dialog/dlg_var.c
@@ -287,8 +287,7 @@ str* get_dlg_varref(struct dlg_cell *dlg, str *key)
{
str* var = NULL;
- if( !dlg || !key || key->len > strlen(key->s))
- {
+ if( !dlg || !key || key->len<=0) {
LM_ERR("BUG - bad parameters\n");
return NULL;
@@ -313,7 +312,7 @@ int get_dlg_varval(struct dlg_cell *dlg, str *key, str *val)
val->s = NULL;
val->len = 0;
- if( !dlg || !key || key->len > strlen(key->s)) {
+ if( !dlg || !key || key->len<=0) {
LM_ERR("BUG - bad parameters\n");
return -1;
}