Skip to content

Commit

Permalink
No issue - avoid potential underflow in StructuredClone.
Browse files Browse the repository at this point in the history
Prevents potential loop-around if there's bogus internal Map data.
  • Loading branch information
wolfbeast committed Feb 16, 2025
1 parent 53b1740 commit 4499f77
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/src/vm/StructuredClone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,8 @@ JSStructuredCloneWriter::write(HandleValue v)
return false;

if (cls == ESClass::Map) {
if (!counts.back())
return false;
counts.back()--;
RootedValue val(context(), entries.back());
entries.popBack();
Expand Down

0 comments on commit 4499f77

Please sign in to comment.