e730b171ea
The bug is that the disassembler doesn't do any bounds checking, other than the outer while loop in Disassembler::Disassemble. For multi byte instructions it relies on having well-formed input to avoid OOB errors. This test is testing something that doesn't happen in real disassembly, because usually the invalid machine code is embedded in valid machine code, so there would be plenty of buffer between the invalid section and the end of the input. The ideal fix would be to rewrite the disassembler to do bounds checks, but short of that we can just add some buffer to the end of bad_input. Bug: https://github.com/dart-lang/sdk/issues/52421 Change-Id: If68d5485a130523ddf2a4d37f1c8e2ddf1cf485a Fixes: https://github.com/dart-lang/sdk/issues/52421 TEST=Disassembler_InvalidInput Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304240 Commit-Queue: Ryan Macnak <rmacnak@google.com> Auto-Submit: Liam Appelbe <liama@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>