Module: kamailio Branch: master Commit: 6b413cc8c7f9c6db019c98a28ab07cf902ef505e URL: https://github.com/kamailio/kamailio/commit/6b413cc8c7f9c6db019c98a28ab07cf9...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-08-01T08:09:34+02:00
permissions: reworked condition checking group id on db load
- ensure it is not null and greater than 0 for both types - update of 6afab49
---
Modified: src/modules/permissions/address.c
---
Diff: https://github.com/kamailio/kamailio/commit/6b413cc8c7f9c6db019c98a28ab07cf9... Patch: https://github.com/kamailio/kamailio/commit/6b413cc8c7f9c6db019c98a28ab07cf9...
---
diff --git a/src/modules/permissions/address.c b/src/modules/permissions/address.c index 3f825fba010..05f56d3dc68 100644 --- a/src/modules/permissions/address.c +++ b/src/modules/permissions/address.c @@ -192,8 +192,13 @@ int reload_address_db_table(address_tables_group_t *atg) ROW_N(row + i)); goto dberror; } - if((VAL_TYPE(val) != DB1_INT && VAL_TYPE(val) != DB1_UINT) - || VAL_NULL(val) || (VAL_INT(val) <= 0)) { + if(VAL_NULL(val)) { + LM_DBG("failure during checks of database value 1 (group) in " + "address table\n"); + goto dberror; + } + if(!((VAL_TYPE(val) == DB1_INT && VAL_INT(val) > 0) + || (VAL_TYPE(val) == DB1_UINT && VAL_UINT(val) > 0))) { LM_DBG("failure during checks of database value 1 (group) in " "address table\n"); goto dberror;