# Add 0-length buffer checks to os.read & os.write · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b5222f86eec68088b9bd83ad2f648654242082ec)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b5222f86eec68088b9bd83ad2f648654242082ec

Requested commit: b5222f86eec68088b9bd83ad2f648654242082ec

Commit: b5222f86eec68088b9bd83ad2f648654242082ec

Tree: efeb5346647a475de4743a42b07316f2c16eb5bb

Author: Tom Maenan Read Cutting

Committer: Andrew Kelley

## Message

```
Add 0-length buffer checks to os.read & os.write

This helps prevent errors related to undefined pointers being passed
through to some OS apis when slices have 0 length.

Tests have also been added to catch these cases.

```

## Parents

- [7d0d99aac0c3e47ab4f82a43525a6f4a18334d43](https://git.cafe/gitcafe/zig/commit/7d0d99aac0c3e47ab4f82a43525a6f4a18334d43?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b5222f86eec68088b9bd83ad2f648654242082ec?format=markdown)
