diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-06-29 12:26:14 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-06-29 12:26:14 +0000 |
commit | de570e25847091e15a22114b7d58365843be5b1d (patch) | |
tree | 16b1387f014ebbe193136340bd7c2ecd28d2e85e /vespamalloc/src/tests/test1/new_test.cpp | |
parent | 77943a40ad87e61f4f547fb3df78c96ed8c68035 (diff) |
Set errno to ENOMEM on reallocarray overflow.
Diffstat (limited to 'vespamalloc/src/tests/test1/new_test.cpp')
-rw-r--r-- | vespamalloc/src/tests/test1/new_test.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vespamalloc/src/tests/test1/new_test.cpp b/vespamalloc/src/tests/test1/new_test.cpp index 131f78cbe05..ac053323255 100644 --- a/vespamalloc/src/tests/test1/new_test.cpp +++ b/vespamalloc/src/tests/test1/new_test.cpp @@ -101,9 +101,11 @@ TEST("verify realloarray") { void *arr2 = reallocarray(arr, 800, 5); EXPECT_NOT_EQUAL(arr, arr2); EXPECT_NOT_EQUAL(nullptr, arr2); + EXPECT_NOT_EQUAL(ENOMEM, errno); void *arr3 = reallocarray(arr2, 1u << 33, 1u << 33); EXPECT_EQUAL(nullptr, arr3); + EXPECT_EQUAL(ENOMEM, errno); } #endif |