forked from mirrors/gecko-dev
Bug 1531071 - Add OOM check in TCPSocketParent, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D23146 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
430b3e5743
commit
edd4b23c65
1 changed files with 4 additions and 1 deletions
|
|
@ -228,7 +228,10 @@ mozilla::ipc::IPCResult TCPSocketParent::RecvData(
|
|||
bool ok = IPC::DeserializeArrayBuffer(autoCx, buffer, &val);
|
||||
NS_ENSURE_TRUE(ok, IPC_OK());
|
||||
RootedSpiderMonkeyInterface<ArrayBuffer> data(autoCx);
|
||||
data.Init(&val.toObject());
|
||||
if (!data.Init(&val.toObject())) {
|
||||
TCPSOCKET_LOG(("%s: Failed to allocate memory", __FUNCTION__));
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
Optional<uint32_t> byteLength(buffer.Length());
|
||||
mSocket->SendWithTrackingNumber(autoCx, data, 0, byteLength,
|
||||
aTrackingNumber, rv);
|
||||
|
|
|
|||
Loading…
Reference in a new issue