Bug 1485762 - when deserializing a shmem in IPC, error if the ID doesn't point to a valid shmem segment; r=jld

Differential Revision: https://phabricator.services.mozilla.com/D4141

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Gaynor 2018-08-24 20:25:42 +00:00
parent f81e9b49d1
commit 9b811a260c

View File

@ -515,13 +515,12 @@ IPDLParamTraits<Shmem>::Read(const IPC::Message* aMsg, PickleIterator* aIter,
}
Shmem::SharedMemory* rawmem = aActor->LookupSharedMemory(id);
if (rawmem) {
*aResult = Shmem(
Shmem::PrivateIPDLCaller(),
rawmem, id);
return true;
if (!rawmem) {
return false;
}
*aResult = Shmem();
*aResult = Shmem(
Shmem::PrivateIPDLCaller(),
rawmem, id);
return true;
}