Index: src/wasm/decoder.h |
diff --git a/src/wasm/decoder.h b/src/wasm/decoder.h |
index 0ca4e47f7525f059820ddc73eb017e821cbce8a9..098c3306da05b0f750a1cc4fb043277b852777d1 100644 |
--- a/src/wasm/decoder.h |
+++ b/src/wasm/decoder.h |
@@ -225,6 +225,8 @@ class Decoder { |
*length = static_cast<int>(pc_ - pos); |
if (pc_ == end && (b & 0x80)) { |
error(pc_ - 1, "varint too large"); |
+ } else if (*length == 0) { |
+ error(pc_, "varint of length 0"); |
} else { |
TRACE("= %u\n", result); |
} |