mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
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>
This commit is contained in:
parent
2b1864c53a
commit
a2aae6a582
1 changed files with 0 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue