-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASM serialization calls std::vector::resize(SIZE_MAX) which always leads to crash #152
Comments
Thanks a lot, can you also leave your gxchain account so we can send you the bug bounty for your contributions. |
my gxchain account is z16166. thanks |
thank you very much! can you supply an example code or method which can leading a crash which can help us to fix the problems ASAP. |
just build the target "gxc-wast2wasm" from gxb-core, and run it, it will core dump. command: |
Thank you very much for the great work you have done, @zhangbo-miuNEST . Have you found that the "witness_node" crash caused by this bug?(
|
No, witness_node is not affected. |
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
The text was updated successfully, but these errors were encountered: