2
0
Эх сурвалжийг харах

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 жил өмнө
parent
commit
5fd2c91f51

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