pchickey opened PR #6225 from bytecodealliance:pch/path_readlink_truncation
to bytecodealliance:main
:
This is the same behavior on a too-small buffer as posix readlink(2).
The correct way to call readlink(2), and therefore path_readlink, is to call it multiple times with incrementally larger buffers until the bytes returned is smaller than the buffer passed in, to ensure the value is not being truncated. Userlands are used to this restriction.
Thankfully this nonsense goes away, thanks to the component model, in preview 2, where path_readlink just gives a string. Only the (host) component interfacing with a posix
readlink(2)
needs to do the truncation detection dance.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
pchickey requested alexcrichton for a review on PR #6225.
pchickey requested wasmtime-core-reviewers for a review on PR #6225.
pchickey requested sunfishcode for a review on PR #6225.
alexcrichton submitted PR review.
pchickey merged PR #6225.
Last updated: Dec 23 2024 at 12:05 UTC