diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-11 14:50:15 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-11 14:50:15 -0800 |
commit | 3a8876cbde436085f6361e93377ee96e3578e2dd (patch) | |
tree | 6df6bcb3216e16ab9debcefcdd3669d6913bf3c7 /src | |
parent | 15903fda75b5392df886b512bae8b8d74fafc61f (diff) | |
download | binaryen-3a8876cbde436085f6361e93377ee96e3578e2dd.tar.gz binaryen-3a8876cbde436085f6361e93377ee96e3578e2dd.tar.bz2 binaryen-3a8876cbde436085f6361e93377ee96e3578e2dd.zip |
validate offsets in s-parser, remove hack
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-s-parser.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 3fd977f09..fcf0e0dd8 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -847,7 +847,9 @@ private: if (str[0] == 'a') { ret->align = atoi(eq); } else if (str[0] == 'o') { - ret->offset = atol(eq); // XXX https://github.com/WebAssembly/spec/issues/161 + uint64_t offset = atol(eq); + if (offset > 0xffffffff) onError(); + ret->offset = offset; } else onError(); i++; } |