Module: kamailio
Branch: master
Commit: 40615aaa64a6a2b3affa112502bec58eda47d9a0
URL:
https://github.com/kamailio/kamailio/commit/40615aaa64a6a2b3affa112502bec58…
Author: Claudiu Boriga <paul.boriga(a)1and1.ro>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-08-01T10:36:01+02:00
carrierroute: avoid comparing size_t types with negative values
---
Modified: src/modules/carrierroute/cr_db.c
---
Diff:
https://github.com/kamailio/kamailio/commit/40615aaa64a6a2b3affa112502bec58…
Patch:
https://github.com/kamailio/kamailio/commit/40615aaa64a6a2b3affa112502bec58…
---
diff --git a/src/modules/carrierroute/cr_db.c b/src/modules/carrierroute/cr_db.c
index 1668cdda55..d651db1b49 100644
--- a/src/modules/carrierroute/cr_db.c
+++ b/src/modules/carrierroute/cr_db.c
@@ -280,15 +280,17 @@ int load_route_data_db(struct route_data_t * rd) {
return -1;
}
- if((rd->carrier_num = load_carrier_map(rd)) <= 0){
+ if((ret = load_carrier_map(rd)) <= 0){
LM_ERR("error while retrieving carriers\n");
goto errout;
}
+ rd->carrier_num = (size_t)ret;
- if((rd->domain_num = load_domain_map(rd)) <= 0){
+ if((ret = load_domain_map(rd)) <= 0){
LM_ERR("error while retrieving domains\n");
goto errout;
}
+ rd->domain_num = (size_t)ret;
if ((rd->carriers = shm_malloc(sizeof(struct carrier_data_t *) * rd->carrier_num))
== NULL) {
SHM_MEM_ERROR;