Fix issue#2445 Null Pointer Deref
Fix issue 2445: https://github.com/WebAssembly/wabt/issues/2445
Hi, After adding this patch, execute the poc, it shows:
# ./wat2wasm ../@POC@
../@POC@:1:2: error: error in quoted module: @0x100000001: unexpected token "|", expected a module field or a module.
(module quote "\7c")
^^^^^^
And ASAN is not triggered.
Do you think we should make some further improvements about it? I'm glad to do it, if needed.
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?
@sbc100 @SoniEx2 Hi folks, I added a testcase, could you also please take a look at it?
https://github.com/WebAssembly/wabt/pull/2461/files#diff-198b0c14be90b6dbd98ff0d8d3289a686f4daa9733c748db3dadfaa5c55635fd
the test looks great. wonder if it would make sense to upstream it...
Hi folks, @SoniEx2 @sbc100
Do you think I need to do some further improvements for this patch? Or we can merge it?
I'd like to help, if further improvements are needed!
ParseWatModule returns a Result, it would be a good idea to check that Result.