From 9e16223877f624c900eb8804016afa5f3f13e385 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 18 Jan 2025 15:08:03 -0500 Subject: sighook: Don't forget to check `initialized` in sigreset() --- src/sighook.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/sighook.c b/src/sighook.c index fc0db6d..1783b83 100644 --- a/src/sighook.c +++ b/src/sighook.c @@ -671,6 +671,10 @@ void sigunhook(struct sighook *hook) { } int sigreset(void) { + if (!load(&initialized, acquire)) { + return 0; + } + for_rcu (struct sigsave, save, &saved) { if (sigaction(save->sig, &save->action, NULL) != 0) { return -1; -- cgit v1.2.3