Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix character boundary issues in preview1 host adapter #7011

Merged

Conversation

alexcrichton
Copy link
Member

@alexcrichton alexcrichton commented Sep 12, 2023

This fixes two separate issues in the preview1-to-preview2 host-side adapter in the wasmtime-wasi crate. Both instances were copying a truncated string to the guest program but the truncation was happening in the middle of a unicode character so truncation now happens on bytes instead of a string.

Closes #7006

This fixes two separate issues in the preview1-to-preview2 host-side
adapter in the `wasmtime-wasi` crate. Both instances were copying a
truncated string to the guest program but the truncation was happening
in the middle of a unicode character so truncation now happens on bytes
instead of a string.
Try to weed out any accidental string-related issues for the future.
@alexcrichton alexcrichton requested a review from a team as a code owner September 12, 2023 21:55
@alexcrichton alexcrichton requested review from pchickey and removed request for a team September 12, 2023 21:55
@github-actions github-actions bot added the wasi Issues pertaining to WASI label Sep 13, 2023
@pchickey pchickey added this pull request to the merge queue Sep 20, 2023
Merged via the queue into bytecodealliance:main with commit 04b09c8 Sep 20, 2023
18 checks passed
eduardomourar pushed a commit to eduardomourar/wasmtime that referenced this pull request Sep 22, 2023
…nce#7011)

* Fix character boundary issues in preview1 host adapter

This fixes two separate issues in the preview1-to-preview2 host-side
adapter in the `wasmtime-wasi` crate. Both instances were copying a
truncated string to the guest program but the truncation was happening
in the middle of a unicode character so truncation now happens on bytes
instead of a string.

* Update `write_bytes` to take `&[u8]`

Try to weed out any accidental string-related issues for the future.
@alexcrichton alexcrichton deleted the fix-string-boundary-issues branch October 25, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WASI panics in fd_readdir when trying to read a directory with the Cyrillic name Действие ("Action")
2 participants