kv: Set finished before the stdin handler removes itself #216

Merged
vitalif merged 1 commits from koolkhel/vitastor:epoll-handler-copy into master 2026-12-04 00:19:52 +03:00

1 Commits

Author SHA1 Message Date
4f9a123dce kv: Set finished before the stdin handler removes itself
Removing its own FD handler destroys the stdin handler's closure while it
runs, so the `finished = true` after it read `this` from freed memory
(heap-use-after-free under ASAN when stdin is a socket whose peer closes).
Set the flag first.
2026-12-02 16:28:37 +03:00