aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2023-01-21 14:54:14 +0100
committerIsaac Freund <mail@isaacfreund.com>2023-01-21 14:54:14 +0100
commita9bfb7c924af2020d1a3c5ab6a0bccc43d2ef821 (patch)
tree90e67c76347aadfb4957b199bfc4ca5fda214665
parent6c7586e8d7c8c6a59b73864fc3096abf3f60d0ac (diff)
downloadriver-a9bfb7c924af2020d1a3c5ab6a0bccc43d2ef821.tar.gz
river-a9bfb7c924af2020d1a3c5ab6a0bccc43d2ef821.tar.xz
idle-inhibit: fix use-after-free
A user reported a crash that only reproduces when preloading a hardened malloc implementation. From the stack trace, this use-after-free seems to be the most likely cause. Yay hardened malloc!
-rw-r--r--river/IdleInhibitor.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/river/IdleInhibitor.zig b/river/IdleInhibitor.zig
index 6482222..2cebf97 100644
--- a/river/IdleInhibitor.zig
+++ b/river/IdleInhibitor.zig
@@ -28,7 +28,8 @@ fn handleDestroy(listener: *wl.Listener(*wlr.IdleInhibitorV1), _: *wlr.IdleInhib
const node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self);
server.idle_inhibitor_manager.inhibitors.remove(node);
- util.gpa.destroy(node);
self.inhibitor_manager.idleInhibitCheckActive();
+
+ util.gpa.destroy(node);
}