[sr-dev] git:master:989ea3d6: lib/srdb1: cast for signed comparison

Daniel-Constantin Mierla miconda at gmail.com
Wed Aug 15 16:46:39 CEST 2018


Module: kamailio
Branch: master
Commit: 989ea3d60ac30d7ecf5a65094c941bc2dcf76629
URL: https://github.com/kamailio/kamailio/commit/989ea3d60ac30d7ecf5a65094c941bc2dcf76629

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-08-15T16:45:38+02:00

lib/srdb1: cast for signed comparison

---

Modified: src/lib/srdb1/db_ut.c

---

Diff:  https://github.com/kamailio/kamailio/commit/989ea3d60ac30d7ecf5a65094c941bc2dcf76629.diff
Patch: https://github.com/kamailio/kamailio/commit/989ea3d60ac30d7ecf5a65094c941bc2dcf76629.patch

---

diff --git a/src/lib/srdb1/db_ut.c b/src/lib/srdb1/db_ut.c
index 1dfb4c80b3..39ac11d379 100644
--- a/src/lib/srdb1/db_ut.c
+++ b/src/lib/srdb1/db_ut.c
@@ -113,7 +113,7 @@ int db_str2uint(const char* _s, unsigned int* _v)
 
 	tmp = strtoul(_s, &p, 10);
 	if ((tmp == ULONG_MAX && errno == ERANGE) ||
-				(tmp < INT_MIN) || (tmp > UINT_MAX)) {
+				((long)tmp < INT_MIN) || (tmp > UINT_MAX)) {
 		LM_ERR("Value out of range\n");
 		return -1;
 	}




More information about the sr-dev mailing list