aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-22 21:36:37 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-22 21:36:37 +0000
commitf640923cab48fdada0ac9135c4e36f2673281c17 (patch)
treef7074c6181d86521ff3a524016747647a624f407
parent53420514a426bc75b592969dd906a4e60b6b00e2 (diff)
parent08534e7ff995196f3de9f225da29e6691511fb7d (diff)
downloadlibbrillo-f640923cab48fdada0ac9135c4e36f2673281c17.tar.gz
Snap for 11135399 from 08534e7ff995196f3de9f225da29e6691511fb7d to simpleperf-release
Change-Id: I016e694c1c8868efc2dea484aa2baf174dd763d1
-rw-r--r--brillo/secure_blob_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/brillo/secure_blob_test.cc b/brillo/secure_blob_test.cc
index 7242e86..871c79c 100644
--- a/brillo/secure_blob_test.cc
+++ b/brillo/secure_blob_test.cc
@@ -255,9 +255,10 @@ class TestSecureAllocator : public SecureAllocator<T> {
TEST(SecureAllocator, ErasureOnDeallocation) {
// Make sure that the contents are cleared on deallocation.
TestSecureAllocator<char> e;
+ constexpr size_t test_string_sz = 15;
- char *test_string_addr = e.allocate(15);
- snprintf(test_string_addr, sizeof(test_string_addr), "Test String");
+ char *test_string_addr = e.allocate(test_string_sz);
+ snprintf(test_string_addr, test_string_sz, "Test String");
// Deallocate memory; the mock class should check for cleared data.
e.deallocate(test_string_addr, 15);