summaryrefslogtreecommitdiffstats
path: root/js/src/vm
diff options
context:
space:
mode:
authorSteve Fink <sfink@mozilla.com>2018-01-05 14:37:47 -0800
committerwolfbeast <mcwerewolf@gmail.com>2018-03-14 12:40:19 +0100
commitc9e08a8af9cc2b9597d75eef1192595252a29550 (patch)
treecfdf6dafef3d3abe705c6988e45bee426c6e4547 /js/src/vm
parent302f17e514772770f5555ce939b21b194514ebc3 (diff)
downloadUXP-c9e08a8af9cc2b9597d75eef1192595252a29550.tar
UXP-c9e08a8af9cc2b9597d75eef1192595252a29550.tar.gz
UXP-c9e08a8af9cc2b9597d75eef1192595252a29550.tar.lz
UXP-c9e08a8af9cc2b9597d75eef1192595252a29550.tar.xz
UXP-c9e08a8af9cc2b9597d75eef1192595252a29550.zip
Bug 1434384 - Mark v1 structured clone data as cross-process. r=jorendorff, a=RyanVM
--HG-- extra : source : d85679eb427513cb18650f3d4e7d37a6ccbefbab extra : intermediate-source : 5c286cc709dfcaca7269b88516e6f71626c98496
Diffstat (limited to 'js/src/vm')
-rw-r--r--js/src/vm/StructuredClone.cpp7
1 files changed, 4 insertions, 3 deletions
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");