mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03: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: https://github.com/SerenityOS/serenity/commit/1c6fd749dc8 Pull-request: https://github.com/SerenityOS/serenity/pull/5339 Reviewed-by: https://github.com/awesomekling
@ -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…
Reference in New Issue
Block a user