[sr-dev] git:master:5fd2c91f: userblacklist: removed errorneous extra checks in fixup parameters function

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 27 13:06:42 CEST 2016


Module: kamailio
Branch: master
Commit: 5fd2c91f512b7311f11c76023da45758fb8c4365
URL: https://github.com/kamailio/kamailio/commit/5fd2c91f512b7311f11c76023da45758fb8c4365

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-06-27T13:04:50+02:00

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

---

Modified: modules/userblacklist/userblacklist.c

---

Diff:  https://github.com/kamailio/kamailio/commit/5fd2c91f512b7311f11c76023da45758fb8c4365.diff
Patch: https://github.com/kamailio/kamailio/commit/5fd2c91f512b7311f11c76023da45758fb8c4365.patch

---

diff --git a/modules/userblacklist/userblacklist.c b/modules/userblacklist/userblacklist.c
index 17aebc2..421f71f 100644
--- a/modules/userblacklist/userblacklist.c
+++ b/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");




More information about the sr-dev mailing list