go-interpreter / wagon

wagon, a WebAssembly-based Go interpreter, for Go.
BSD 3-Clause "New" or "Revised" License
902 stars 150 forks source link

wasm: fix leb128 decoding #154

Closed laizy closed 5 years ago

laizy commented 5 years ago

the original implementation missing some checks:

  1. overflow check
  2. encoded integer must not exceed ceil(N/7) bytes.
  3. ReadVarint32 is directly truncated from int64