Skip to content

Commit

Permalink
std: Don't pass undefined memory to the kernel in os.abort()
Browse files Browse the repository at this point in the history
  • Loading branch information
ifreund committed Aug 11, 2022
1 parent 9f1f60f commit 7d6a7f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/std/os.zig
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,8 @@ pub fn abort() noreturn {
// Install default handler so that the tkill below will terminate.
const sigact = Sigaction{
.handler = .{ .sigaction = SIG.DFL },
.mask = undefined,
.flags = undefined,
.restorer = undefined,
.mask = empty_sigset,
.flags = 0,
};
sigaction(SIG.ABRT, &sigact, null) catch |err| switch (err) {
error.OperationNotSupported => unreachable,
Expand Down

0 comments on commit 7d6a7f5

Please sign in to comment.