зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1605514 - Avoid hard-crashing on malformed data while fuzzing, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D58986 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
9e26acd416
Коммит
f1f201780c
|
@ -1502,6 +1502,7 @@ bool IPDLParamTraits<dom::BrowsingContext*>::Read(
|
|||
|
||||
RefPtr<dom::BrowsingContext> browsingContext = dom::BrowsingContext::Get(id);
|
||||
if (!browsingContext) {
|
||||
#ifndef FUZZING
|
||||
// NOTE: We could fail softly by returning `false` if the `BrowsingContext`
|
||||
// isn't present, but doing so will cause a crash anyway. Let's improve
|
||||
// diagnostics by reliably crashing here.
|
||||
|
@ -1509,6 +1510,7 @@ bool IPDLParamTraits<dom::BrowsingContext*>::Read(
|
|||
// If we can recover from failures to deserialize in the future, this crash
|
||||
// should be removed or modified.
|
||||
MOZ_CRASH("Attempt to deserialize absent BrowsingContext");
|
||||
#endif
|
||||
*aResult = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче