Skip to content

Commit

Permalink
b2b_entities: fix crash if DB loaded entity hash_index is too large
Browse files Browse the repository at this point in the history
(cherry picked from commit 2617ca4)
  • Loading branch information
rvlad-patrascu committed Feb 5, 2021
1 parent 4033d00 commit 1b9c8cb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/b2b_entities/b2be_db.c
Expand Up @@ -491,6 +491,12 @@ int b2b_entities_restore(void)
LM_ERR("Wrong format for b2b key [%.*s]\n", dlg.tag[1].len, dlg.tag[1].s);
goto error;
}

if (hash_index >= server_hsize) {
LM_ERR("Hash Index [%d] too large! Increase the 'server_hsize'"
"parameter!\n", hash_index);
goto error;
}
}
else
{
Expand All @@ -501,6 +507,12 @@ int b2b_entities_restore(void)
LM_ERR("Wrong format for b2b key [%.*s]\n", dlg.callid.len, dlg.callid.s);
goto error;
}

if (hash_index >= client_hsize) {
LM_DBG("Hash Index [%d] too large! Increase the 'client_hsize'"
"parameter!\n", hash_index);
goto error;
}
}
dlg.id = local_index;
dlg.state = row_vals[13].val.int_val;
Expand Down

0 comments on commit 1b9c8cb

Please sign in to comment.