Skip to content

Commit

Permalink
p_usrloc: fix dereference before null check in code path
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalaceanu committed Aug 3, 2017
1 parent f567695 commit d58fdb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/p_usrloc/ul_db_query.c
Expand Up @@ -37,13 +37,15 @@ int db_query(ul_db_handle_t * handle, db1_con_t *** _r_h, db_func_t ** _r_f,
int i;
int err[DB_NUM];
int ret = -1;
order_dbs(handle, order);
memset(err, 0 , sizeof(int) * DB_NUM);

if(!handle || !table || !table->s || !_r_h) {
LM_ERR("NULL pointer in parameter.\n");
return -1;
}

order_dbs(handle, order);
memset(err, 0 , sizeof(int) * DB_NUM);

i = 0;
do {
LM_DBG("now trying id %i, db %i.\n", handle->id, handle->db[order[i]].no);
Expand Down

0 comments on commit d58fdb7

Please sign in to comment.