Description[wasm] improve handling of malformed inputs
When reading malformed input, the length of variable-length types can be very large. Computing operand length with this and adding it to PC will overflow and screw up decode.
This patch switches to unsigned int for arity and lengths, terminates loop analysis on error, adds overflow checking to BranchTableOperand, and adds a unit test.
Committed: https://crrev.com/fd2bf837a536827ea697a4a4de970886a4c288bc
Cr-Commit-Position: refs/heads/master@{#37301}
Patch Set 1 #Patch Set 2 : remove debugging statement #
Total comments: 1
Patch Set 3 : use unsigned, terminate loop analysis on error, add unit test #
Total comments: 1
Patch Set 4 : add overflow check to BranchTableOperand #
Total comments: 2
Patch Set 5 : use nullptr and decoder error() instead of CHECK() #Patch Set 6 : rebase #
Messages
Total messages: 29 (11 generated)
|