Skip to content

Commit

Permalink
dialog: remove strlen() checks when setting a variable
Browse files Browse the repository at this point in the history
- assumed key->s and val->s are 0-terminated, which may not be the case

(cherry picked from commit 2cebd46)
  • Loading branch information
miconda committed Sep 14, 2022
1 parent 2427f19 commit 644938a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/dialog/dlg_var.c
Expand Up @@ -352,7 +352,7 @@ int get_dlg_variable_uintval(struct dlg_cell *dlg, str *key, unsigned int *uval)
int set_dlg_variable(struct dlg_cell *dlg, str *key, str *val)
{
int ret = -1;
if( !dlg || !key || key->len > strlen(key->s) || (val && val->len > strlen(val->s)))
if( !dlg || !key || !key->s || key->len<=0 )
{
LM_ERR("BUG - bad parameters\n");
return -1;
Expand Down

0 comments on commit 644938a

Please sign in to comment.