[PATCH] Catch errors with sigaddset(3) in sigaddset (sighold)
Garrett Cooper
yanegomi at gmail.com
Mon Jul 19 05:46:26 UTC 2010
sighold(3) doesn't determine whether or not the signal added is
valid today (and sigprocmask doesn't verify that either). This fixes
that.
Thanks,
-Garrett
Index: sigcompat.c
===================================================================
--- sigcompat.c (revision 210226)
+++ sigcompat.c (working copy)
@@ -131,7 +131,8 @@
sigset_t set;
sigemptyset(&set);
- sigaddset(&set, sig);
+ if (sigaddset(&set, sig) == -1)
+ return (-1);
return (_sigprocmask(SIG_BLOCK, &set, NULL));
}
More information about the freebsd-hackers
mailing list