The documentation for __wasi_environ_get says "The sizes of the buffers should match that returned by __wasi_environ_sizes_get" but the WASI implementations that I tested (wasmtime and wasmer) expect a buffer with space for additional null pointer at the end. The sysroot too implements it that way.
This is in contrast with __wasi_args_get and __wasi_args_sizes_get that say the same thing but do as documented.
I'm not sure if this is a bug or the expected behavior. If it is, it should be documented as such.
The documentation for
__wasi_environ_getsays "The sizes of the buffers should match that returned by__wasi_environ_sizes_get" but the WASI implementations that I tested (wasmtime and wasmer) expect a buffer with space for additional null pointer at the end. The sysroot too implements it that way.This is in contrast with
__wasi_args_getand__wasi_args_sizes_getthat say the same thing but do as documented.I'm not sure if this is a bug or the expected behavior. If it is, it should be documented as such.