瀏覽代碼

userblacklist: removed errorneous extra checks in fixup parameters function

- 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
Daniel-Constantin Mierla 9 年之前
父節點
當前提交
5fd2c91f51
共有 1 個文件被更改,包括 0 次插入16 次删除
  1. 0 16
      modules/userblacklist/userblacklist.c

+ 0 - 16
modules/userblacklist/userblacklist.c

@@ -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");