From c9e08a8af9cc2b9597d75eef1192595252a29550 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Fri, 5 Jan 2018 14:37:47 -0800 Subject: Bug 1434384 - Mark v1 structured clone data as cross-process. r=jorendorff, a=RyanVM --HG-- extra : source : d85679eb427513cb18650f3d4e7d37a6ccbefbab extra : intermediate-source : 5c286cc709dfcaca7269b88516e6f71626c98496 --- js/src/vm/StructuredClone.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'js/src') diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp index 4b01cda85..3a062c3b8 100644 --- a/js/src/vm/StructuredClone.cpp +++ b/js/src/vm/StructuredClone.cpp @@ -2188,12 +2188,14 @@ JSStructuredCloneReader::readHeader() return in.reportTruncated(); if (tag != SCTAG_HEADER) { - // Old structured clone buffer. We must have read it from disk or - // somewhere, so we can assume it's scope-compatible. + // Old structured clone buffer. We must have read it from disk. + storedScope = JS::StructuredCloneScope::DifferentProcess; return true; } MOZ_ALWAYS_TRUE(in.readPair(&tag, &data)); + storedScope = JS::StructuredCloneScope(data); + if (data != uint32_t(JS::StructuredCloneScope::SameProcessSameThread) && data != uint32_t(JS::StructuredCloneScope::SameProcessDifferentThread) && data != uint32_t(JS::StructuredCloneScope::DifferentProcess)) @@ -2202,7 +2204,6 @@ JSStructuredCloneReader::readHeader() "invalid structured clone scope"); return false; } - storedScope = JS::StructuredCloneScope(data); if (storedScope < allowedScope) { JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA, "incompatible structured clone scope"); -- cgit v1.2.3