Skip to content

WASM serialization calls std::vector::resize(SIZE_MAX) which always leads to crash #152

Open
@zhangbo-miuNEST

Description

@zhangbo-miuNEST

100% crash.

file: libraries/wasm-jit/Source/WASM/WASMSerialization.cpp
line: 384

OutputStream::capacity() always returns SIZE_MAX, so std::vector::resize(SIZE_MAX) always leads to crash. Please comment it out. Thanks.

void serialize(OutputStream& stream,UserSection& userSection)
{
userSection.data.resize( sectionStream.capacity() ? sectionStream.capacity() : 1 );
}

The latest WAVM source code has commented it out, but EOS and gxb-core don't synchronize with it yet.
https://github.com/EOSIO/eos/blob/master/libraries/wasm-jit/Source/WASM/WASMSerialization.cpp

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions