Skip to content

Commit

Permalink
idle-inhibit: fix use-after-free
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
ifreund committed Jan 21, 2023
1 parent 6c7586e commit a9bfb7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion river/IdleInhibitor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit a9bfb7c

Please sign in to comment.