зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1153090 followup - consistently use sizeof(hash) r=dkeeler
This commit is contained in:
Родитель
704119af1f
Коммит
c755113bc5
|
@ -95,10 +95,12 @@ uint32_t
|
|||
CertBlocklistItem::Hash() const
|
||||
{
|
||||
uint32_t hash;
|
||||
// there's no requirement for a serial to be as large as 32 bits; if it's
|
||||
// smaller, fall back to the first octet (otherwise, the last four)
|
||||
if (mItemMechanism == BlockByIssuerAndSerial && mOtherLength >= 4) {
|
||||
memcpy(&hash, mOtherData + mOtherLength - 4, sizeof(hash));
|
||||
// there's no requirement for a serial to be as large as the size of the hash
|
||||
// key; if it's smaller, fall back to the first octet (otherwise, the last
|
||||
// four)
|
||||
if (mItemMechanism == BlockByIssuerAndSerial &&
|
||||
mOtherLength >= sizeof(hash)) {
|
||||
memcpy(&hash, mOtherData + mOtherLength - sizeof(hash), sizeof(hash));
|
||||
} else {
|
||||
hash = *mOtherData;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче