Skip to content

Commit

Permalink
unit_tests: add check for page size > 0 before dividing
Browse files Browse the repository at this point in the history
Coverity 188426
  • Loading branch information
moneromooo-monero committed Sep 27, 2018
1 parent d8b1ec8 commit a085da3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/unit_tests/mlocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ TEST(mlocker, cross_page)
TEST(mlocker, redundant)
{
const size_t page_size = epee::mlocker::get_page_size();
ASSERT_TRUE(page_size > 0);
const size_t base_pages = epee::mlocker::get_num_locked_pages();
const size_t base_objects = epee::mlocker::get_num_locked_objects();
std::unique_ptr<char[]> data{new char[2 * page_size]};
Expand Down

0 comments on commit a085da3

Please sign in to comment.