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

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

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

Visibility: public

Requested revision: d0eef26687ca2b4b206b70f001741314d4b8bae8

Requested commit: d0eef26687ca2b4b206b70f001741314d4b8bae8

Commit: d0eef26687ca2b4b206b70f001741314d4b8bae8

Tree: 412effd210ef65092381783da7397e4376a7280a

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

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

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