[sr-dev] git:master:a7571233: dialog: update check on dialog var key length

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 26 12:05:23 CEST 2022


Module: kamailio
Branch: master
Commit: a7571233bc7dee0381e8ed7e44408f63fa45c156
URL: https://github.com/kamailio/kamailio/commit/a7571233bc7dee0381e8ed7e44408f63fa45c156

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/a7571233bc7dee0381e8ed7e44408f63fa45c156.diff
Patch: https://github.com/kamailio/kamailio/commit/a7571233bc7dee0381e8ed7e44408f63fa45c156.patch

---

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;
 	}




More information about the sr-dev mailing list