зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ad9857e4fb96 (bug 1440727) for causing build bustages in clone-errors.js CLOSED TREE
This commit is contained in:
Родитель
134475e4dd
Коммит
6a8c96bc09
|
@ -37,17 +37,4 @@ for (let [write_scope, read_scope] of [['SameProcess', 'DifferentProcessForIndex
|
|||
assertEq(caught, true, `${write_scope} clone buffer should not be deserializable as ${read_scope}`);
|
||||
}
|
||||
|
||||
// Extra data.
|
||||
var clone = serialize({foo: 7}, undefined, {scope: 'DifferentProcess'});
|
||||
deserialize(clone);
|
||||
clone.clonebuffer = clone.clonebuffer + "\0\0\0\0\0\0\0\0";
|
||||
var exc = {message: 'no error'};
|
||||
try {
|
||||
deserialize(clone);
|
||||
} catch (e) {
|
||||
exc = e;
|
||||
}
|
||||
assertEq(exc.message.includes("bad serialized structured data"), true);
|
||||
assertEq(exc.message.includes("extra data"), true);
|
||||
|
||||
reportCompare(0, 0, "ok");
|
||||
|
|
|
@ -3362,18 +3362,6 @@ bool JSStructuredCloneReader::read(MutableHandleValue vp, size_t nbytes) {
|
|||
|
||||
allObjs.clear();
|
||||
|
||||
// For fuzzing, it is convenient to allow extra data at the end
|
||||
// of the input buffer so that more possible inputs are considered
|
||||
// valid.
|
||||
#ifndef FUZZING
|
||||
if (!in.tell().done()) {
|
||||
JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr,
|
||||
JSMSG_SC_BAD_SERIALIZED_DATA,
|
||||
"extra data after end");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
JSRuntime* rt = context()->runtime();
|
||||
rt->addTelemetry(JS_TELEMETRY_DESERIALIZE_BYTES,
|
||||
static_cast<uint32_t>(std::min(nbytes, size_t(MAX_UINT32))));
|
||||
|
|
Загрузка…
Ссылка в новой задаче