Skip to content

Commit

Permalink
userblacklist: removed errorneous extra checks in fixup parameters fu…
Browse files Browse the repository at this point in the history
…nction

- parsing the parameters should be enough for validity
- no need to attempt to parse to integer first parameter, it's not
  expected and results in a crash for static string parameters
- reported by Jan Hazenberg
  • Loading branch information
miconda committed Jun 27, 2016
1 parent 21321c7 commit 5fd2c91
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions modules/userblacklist/userblacklist.c
Expand Up @@ -208,22 +208,6 @@ static int check_user_blacklist_fixup(void** param, int param_no)
return E_UNSPEC;
}

if(model->spec==NULL || model->spec->getf==NULL) {
if(param_no == 1) {
if(str2int(&s, (unsigned int*)&model->spec->pvp.pvn.u.isname.name.n) != 0) {
LM_ERR("wrong value [%.*s] for parameter %d\n", s.len, s.s, param_no);
return E_UNSPEC;
}
} else {
if(param_no == 2 || param_no == 3) {
LM_ERR("wrong value [%.*s] for parameter %d\n", s.len, s.s, param_no);
return E_UNSPEC;
} else {
// only a string
return 0;
}
}
}
*param = (void*)model;
} else {
LM_ERR("wrong number of parameters\n");
Expand Down

0 comments on commit 5fd2c91

Please sign in to comment.