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

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

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

Visibility: public

Requested revision: b5174455f8049b926b9e712ed8f77c13327ffe8c

Requested commit: b5174455f8049b926b9e712ed8f77c13327ffe8c

Commit: b5174455f8049b926b9e712ed8f77c13327ffe8c

Tree: 91e7c23f828804f240eff4587c735a0ba6607ad2

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

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

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