Skip to content

Commit 50a26f4

Browse files
committed
deps: V8: cherry-pick 501482cbc704
Original commit message: Fix ValueDeserializer::ReadDouble() bounds check If end_ is smaller than sizeof(double), the result would wrap around, and lead to an invalid memory access. Refs: #37978 Change-Id: Ibc8ddcb0c090358789a6a02f550538f91d431c1d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2801353 Reviewed-by: Marja Hölttä <[email protected]> Commit-Queue: Marja Hölttä <[email protected]> Cr-Commit-Position: refs/heads/master@{#73800} Refs: v8/v8@501482cbc704 Fixes: #37978
1 parent 6986fa0 commit 50a26f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

deps/v8/src/objects/value-serializer.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,8 @@ Maybe<T> ValueDeserializer::ReadZigZag() {
11901190

11911191
Maybe<double> ValueDeserializer::ReadDouble() {
11921192
// Warning: this uses host endianness.
1193-
if (position_ > end_ - sizeof(double)) return Nothing<double>();
1193+
if (sizeof(double) > static_cast<unsigned>(end_ - position_))
1194+
return Nothing<double>();
11941195
double value;
11951196
base::Memcpy(&value, position_, sizeof(double));
11961197
position_ += sizeof(double);

0 commit comments

Comments
 (0)