-
Notifications
You must be signed in to change notification settings - Fork 702
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
Fix issue#2445 Null Pointer Deref #2461
base: main
Are you sure you want to change the base?
Conversation
@@ -3439,7 +3439,11 @@ Result WastParser::ParseModuleCommand(Script* script, CommandPtr* out_command) { | |||
error.loc.offset, error.message.c_str()); | |||
} | |||
} | |||
*module = std::move(*m.get()); | |||
if (m) { | |||
*module = std::move(*m.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for ParseWatModule
above to succeed without *m
being set?
Would this work instead:
if (errors.length()) {
return Result::Error;
}
assert(*m);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't ParseWatModule
also return a Result
? probably a good idea to check that instead.
Hi,
And ASAN is not triggered. Do you think we should make some further improvements about it? |
It would be good to add that as a test case I think. Seems like the kind of test that could also be upstreamed to the wasm spec test suite too (once it lands here). |
If I want to add it into test case, should I directly add a .txt file to https://github.com/WebAssembly/wabt/tree/main/test/parse? |
the test looks great. wonder if it would make sense to upstream it... |
Fix issue 2445:
#2445