Skip to content
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

validate accepts invalid wasm #58

Closed
nlewycky opened this issue Jul 17, 2020 · 0 comments · Fixed by #61
Closed

validate accepts invalid wasm #58

nlewycky opened this issue Jul 17, 2020 · 0 comments · Fixed by #61

Comments

@nlewycky
Copy link
Contributor

The attached wasm file (g
x.wasm.gz
zipped due to github file type detection) triggers no errors with the wasmparser validator, but it has an invalidly large label index (0x8180808021) in the br_table default label.

Wabt detects the error:

$ wabt/build/wasm2wat x.wasm
000001f: error: unable to read u32 leb128: br_table default target depth
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this issue Jul 20, 2020
This commit unifies parsing methods of `BrTable` to make sure there's
only one way to parse it, and then it ensures that the one way to parse
it handles everything necessary to parse it, namely parsing N items as
specified by the count of the table instruction.

Closes bytecodealliance#58
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this issue Jul 20, 2020
This commit unifies parsing methods of `BrTable` to make sure there's
only one way to parse it, and then it ensures that the one way to parse
it handles everything necessary to parse it, namely parsing N items as
specified by the count of the table instruction.

Closes bytecodealliance#58
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this issue Jul 20, 2020
This commit unifies parsing methods of `BrTable` to make sure there's
only one way to parse it, and then it ensures that the one way to parse
it handles everything necessary to parse it, namely parsing N items as
specified by the count of the table instruction.

Closes bytecodealliance#58
alexcrichton added a commit that referenced this issue Jul 20, 2020
This commit unifies parsing methods of `BrTable` to make sure there's
only one way to parse it, and then it ensures that the one way to parse
it handles everything necessary to parse it, namely parsing N items as
specified by the count of the table instruction.

Closes #58
fitzgen pushed a commit to fitzgen/wasm-tools that referenced this issue Oct 21, 2020
dhil added a commit to dhil/wasm-tools that referenced this issue Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant