# Io.Threaded: fix UAF-induced crashes during asynchronous operations · gitcafe/zig

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

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

Visibility: public

Requested revision: 90890fcb5cf39e53dc470db8260964f95b607937

Requested commit: 90890fcb5cf39e53dc470db8260964f95b607937

Commit: 90890fcb5cf39e53dc470db8260964f95b607937

Tree: 66e9cc20425c4a4226aaf7cfb4b73976049c4520

Author: Jacob Young

Committer: Andrew Kelley

## Message

```
Io.Threaded: fix UAF-induced crashes during asynchronous operations

When `NtReadFile` returns `SUCCESS`, the APC routine still runs when
next alertable, which was previously clobbering an out of scope `done`.
Instead of adding an extra syscall to the success path, avoid all APC
side effects, allowing instant completions to return immediately.

```

## Parents

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

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