Skip to content

Commit 66dc267

Browse files
authored
Fix a fuzz bug with peeking forward in binary reading. (#1902)
Fixes #1900
1 parent ab35a43 commit 66dc267

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/wasm/wasm-binary.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,8 +1806,7 @@ void WasmBinaryBuilder::visitBlock(Block* curr) {
18061806
curr->name = getNextLabel();
18071807
breakStack.push_back({curr->name, curr->type != none});
18081808
stack.push_back(curr);
1809-
auto peek = input[pos];
1810-
if (peek == BinaryConsts::Block) {
1809+
if (more() && input[pos] == BinaryConsts::Block) {
18111810
// a recursion
18121811
readNextDebugLocation();
18131812
curr = allocator.alloc<Block>();

0 commit comments

Comments
 (0)