зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1672388 - Validate hyphenation data before freezing the shared memory, which will unmap it. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D94320
This commit is contained in:
Родитель
938a174ee2
Коммит
9bf2742736
|
@ -161,15 +161,16 @@ static UniquePtr<base::SharedMemory> LoadFromURI(nsIURI* aURI,
|
|||
bytesRead != available) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!shm->Freeze()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!mapped_hyph_is_valid_hyphenator(
|
||||
reinterpret_cast<const uint8_t*>(buffer), bytesRead)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!shm->Freeze()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
*aLength = bytesRead;
|
||||
return shm;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче