mirror of
https://github.com/Z3Prover/z3
synced 2025-10-04 06:53:58 +00:00
Adding overflow checks
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
fcc351eba6
commit
878905c13c
4 changed files with 30 additions and 6 deletions
|
@ -275,6 +275,9 @@ namespace datalog {
|
|||
//the following two operations allow breaking of the object invariant!
|
||||
void resize_data(unsigned sz) {
|
||||
m_data_size = sz;
|
||||
if (sz + sizeof(uint64) < sz) {
|
||||
throw default_exception("overflow resizing data section for sparse table");
|
||||
}
|
||||
m_data.resize(sz + sizeof(uint64));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue