From 7d6a7f513b0053be4e1629de492cbde9215c442c Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 11 Aug 2022 11:04:26 +0200 Subject: [PATCH] std: Don't pass undefined memory to the kernel in os.abort() --- lib/std/os.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/std/os.zig b/lib/std/os.zig index 1192c72629..b068a11229 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -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,