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

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

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

Visibility: public

Requested revision: 456e0492f271957738a6502713c5382e45fb6296

Requested commit: 456e0492f271957738a6502713c5382e45fb6296

Commit: 456e0492f271957738a6502713c5382e45fb6296

Tree: 9cd5ad47ea8b3ffdcfa3aecf24c0a6025da7e485

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

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

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