Commit e0ab7864 authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm][fuzzer] Check that global init. does not start beyond code end

Bug: chromium:1104053
Change-Id: Iacfeeb80ab981f20dc2fc40cf8435514876fcf28
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2307233Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68944}
parent 90271b75
......@@ -1638,6 +1638,10 @@ class ModuleDecoderImpl : public Decoder {
}
WasmInitExpr consume_init_expr(WasmModule* module, ValueType expected) {
if (pc() >= end()) {
error(pc(), "Global initializer starting beyond code end");
return {};
}
constexpr Decoder::ValidateFlag validate = Decoder::kValidate;
WasmOpcode opcode = kExprNop;
std::vector<WasmInitExpr> stack;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment