summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2021-12-24 12:10:29 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-24 14:35:33 -0800
commita2aae6a58292c6e4f754339f4750312709bf3be3 (patch)
treeab381b9dc544e707b1187b0d502b31ae204b35e3 /Userland
parent2b1864c53a13cfbd868e9c3b41f0d1f3d2ea2ff7 (diff)
downloadserenity-a2aae6a58292c6e4f754339f4750312709bf3be3.zip
LibCrypto: Remove redundant __builtin_memset() call
This call caused GCC 12's static analyzer to think that we perform an out-of-bounds write to the v_key Vector. This is obviously incorrect, and comes from the fact that GCC doesn't properly track whether we use the inline storage, or the Vector is allocated on the heap. While searching for a workaround, Sam pointed out that this call is redundant as `Vector::resize()` already zeroes out the elements, so we can completely remove it. Co-authored-by: Sam Atkins <atkinssj@serenityos.org>
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibCrypto/Authentication/HMAC.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCrypto/Authentication/HMAC.h b/Userland/Libraries/LibCrypto/Authentication/HMAC.h
index 55d919c238..c1abba3956 100644
--- a/Userland/Libraries/LibCrypto/Authentication/HMAC.h
+++ b/Userland/Libraries/LibCrypto/Authentication/HMAC.h
@@ -85,7 +85,6 @@ private:
// Note: The block size of all the current hash functions is 512 bits.
Vector<u8, 64> v_key;
v_key.resize(block_size);
- __builtin_memset(v_key.data(), 0, block_size);
auto key_buffer = v_key.span();
// m_key_data is zero'd, so copying the data in
// the first few bytes leaves the rest zero, which