Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

wasi_path_readlink: do not return EINVAL if an empty buffer is supplied#213

Merged
jedisct1 merged 1 commit intomasterfrom
fdenis/wasi-readlink-zero
Jun 17, 2019
Merged

wasi_path_readlink: do not return EINVAL if an empty buffer is supplied#213
jedisct1 merged 1 commit intomasterfrom
fdenis/wasi-readlink-zero

Conversation

@jedisct1
Copy link
Copy Markdown
Contributor

POSIX mentions that readlink(2) and readlinkat(2) can accept an empty buffer.

As usual, Linux doesn't follow the specification, and returns EINVAL if the buffer length is zero.

Work around this by allocating a dummy buffer if the length is zero.

Bug originally spotted in wasi-common, but different fix.

POSIX mentions that readlink(2) and readlinkat(2) can accept an empty buffer.

As usual, Linux doesn't follow the specification, and returns EINVAL if the
buffer length is zero.

Work around this by allocating a dummy buffer if the length is zero.

Bug spotted in wasi-common, but different fix.
@jedisct1 jedisct1 merged commit 8b20e95 into master Jun 17, 2019
@jedisct1 jedisct1 deleted the fdenis/wasi-readlink-zero branch June 17, 2019 11:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants