diff options
author | AdityaK <appujee@google.com> | 2023-11-02 22:50:41 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-11-02 22:50:41 +0000 |
commit | eab0ce3057067a027478dd677a74190f6d2b6cf6 (patch) | |
tree | f7074c6181d86521ff3a524016747647a624f407 | |
parent | 9c9e93eccae01a93d1e8793d445366530e31dfa4 (diff) | |
parent | f98627fa79bedae0e7c4031cf64fe76f27016f48 (diff) | |
download | libbrillo-eab0ce3057067a027478dd677a74190f6d2b6cf6.tar.gz |
Fix snprintf format error am: 08534e7ff9 am: 5109089374 am: f98627fa79
Original change: https://android-review.googlesource.com/c/platform/external/libbrillo/+/2813336
Change-Id: I651bbccfb5bdc13d9e486bc501eebfa1760e9be5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | brillo/secure_blob_test.cc | 5 |
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); |