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

Reading metadata from a non-WebAssembly file creates an infinite iterator #318

Merged
merged 2 commits into from
Sep 19, 2021

Conversation

Michael-F-Bryan
Copy link
Contributor

Because of the way wasmparser's Parser::parse_all() method is implemented, triggering a "bad magic number" error won't let the parser make any progress, meaning if you don't break on errors you'll get an infinite iterator.

Later on we skip any errors and try to iterate over every Payload in the infinite iterator, causing commands like rune inspect and rune run to run forever.

Fixes #315.

@Michael-F-Bryan Michael-F-Bryan merged commit a1aff59 into master Sep 19, 2021
@Michael-F-Bryan Michael-F-Bryan deleted the 315-accidental-infinite-loop branch September 19, 2021 18:52
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 this pull request may close these issues.

(bug) CLI does not validate if the specified Rune is valid.
1 participant