Browse code

dialog: update check on dialog var key length

(cherry picked from commit a7571233bc7dee0381e8ed7e44408f63fa45c156)

Daniel-Constantin Mierla authored on 26/09/2022 09:46:59
Showing 1 changed files
... ...
@@ -287,8 +287,7 @@ str* get_dlg_varref(struct dlg_cell *dlg, str *key)
287 287
 {
288 288
     str* var = NULL;
289 289
 
290
-    if( !dlg || !key || key->len > strlen(key->s))
291
-    {
290
+    if( !dlg || !key || key->len<=0) {
292 291
         LM_ERR("BUG - bad parameters\n");
293 292
 
294 293
         return NULL;
... ...
@@ -313,7 +312,7 @@ int get_dlg_varval(struct dlg_cell *dlg, str *key, str *val)
313 312
 	val->s = NULL;
314 313
 	val->len = 0;
315 314
 
316
-	if( !dlg || !key || key->len > strlen(key->s)) {
315
+	if( !dlg || !key || key->len<=0) {
317 316
 		LM_ERR("BUG - bad parameters\n");
318 317
 		return -1;
319 318
 	}