mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibCrypto: memcmp() all bytes in UnsignedBigInteger::operator==
`length` is only the (trimmed) size of the word vector, so we have to multiply it with the size of each element to ensure all bytes are compared. Fixes #5335.
This commit is contained in:
parent
781d29a337
commit
1c6fd749dc
Notes:
sideshowbarker
2024-07-18 22:20:16 +09:00
Author: https://github.com/linusg
Commit: 1c6fd749dc
Pull-request: https://github.com/SerenityOS/serenity/pull/5339
Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 1 deletions
|
@ -281,7 +281,7 @@ bool UnsignedBigInteger::operator==(const UnsignedBigInteger& other) const
|
|||
if (length != other.trimmed_length())
|
||||
return false;
|
||||
|
||||
return !__builtin_memcmp(m_words.data(), other.words().data(), length);
|
||||
return !__builtin_memcmp(m_words.data(), other.words().data(), length * (BITS_IN_WORD / 8));
|
||||
}
|
||||
|
||||
bool UnsignedBigInteger::operator!=(const UnsignedBigInteger& other) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue