diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-27 11:54:50 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-27 11:59:52 +0000 |
commit | a085da32476148f86a0688c10cf97260c1a4bc23 (patch) | |
tree | 9e3b331b0d880be735a9b0f7519e3b0dce1be952 | |
parent | unit_tests: use std::shared_ptr to shut coverity up about leaks (diff) | |
download | monero-a085da32476148f86a0688c10cf97260c1a4bc23.tar.xz |
unit_tests: add check for page size > 0 before dividing
Coverity 188426
-rw-r--r-- | tests/unit_tests/mlocker.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/unit_tests/mlocker.cpp b/tests/unit_tests/mlocker.cpp index 93434baf0..c97dc2c1d 100644 --- a/tests/unit_tests/mlocker.cpp +++ b/tests/unit_tests/mlocker.cpp @@ -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]}; |