bytecodealliance / bytecodealliance/wasmtime

Fixed-length lists can overflow in ABI calculations for the size of the list

Open
#13,980 0 comments 1 reaction 0 assignees View on GitHub
wasm-proposal:component-model
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 19h
Merged PRs (30d)
121

Description

This input:

```wasm
(component
(type $l (list u64 1073741824))
(type $t (tuple $l $l))
(type $f (func (param "a" $t)))
(import "x" (func (type $f)))
)
```

fails with:

```
$ cargo run compile bigflist3.wat -W component-model-fixed-length-lists
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
Running `/home/alex/code/wasmtime2/target/debug/wasmtime compile bigflist3.wat -W component-model-fixed-length-lists`

thread 'main' (2608010) panicked at crates/environ/src/component/types.rs:679:5:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.