summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-09-12 16:25:20 -0700
committerGitHub <noreply@github.com>2018-09-12 16:25:20 -0700
commit18adb993929883fedf24655195d988c7f5105bb1 (patch)
treed771ecb649d491c2d07f7e7aefee224c15acdebe /src/wasm/wasm-binary.cpp
parent5d9ff4e46b595a5f20aa4732256462609a9614ea (diff)
downloadbinaryen-18adb993929883fedf24655195d988c7f5105bb1.tar.gz
binaryen-18adb993929883fedf24655195d988c7f5105bb1.tar.bz2
binaryen-18adb993929883fedf24655195d988c7f5105bb1.zip
Misc tiny fuzz fixes (#1668)
* show a proper error for an empty asm2wasm input * handle end of input in processExpressions in binary reading * memory segment sizes should be unsigned * validate input in wasm-ctor-eval * update tests
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index c60a3074a..5f4ace91b 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -1341,6 +1341,7 @@ void WasmBinaryBuilder::processExpressions() {
if (pos == endOfFunction) {
throwError("Reached function end without seeing End opcode");
}
+ if (!more()) throwError("unexpected end of input");
auto peek = input[pos];
if (peek == BinaryConsts::End || peek == BinaryConsts::Else) {
if (debug) std::cerr << "== processExpressions finished with unreachable" << std::endl;