Fwd: [PATCH] Catch errors with sigaddset(3) in sigaddset (*sigset)
Garrett Cooper
yanegomi at gmail.com
Mon Jul 19 05:10:09 UTC 2010
CCing hackers at .
---------- Forwarded message ----------
From: Garrett Cooper <yanegomi at gmail.com>
Date: Sun, Jul 18, 2010 at 10:06 PM
Subject: [PATCH] Catch errors with sigaddset(3) in sigaddset (*sigset)
To: Kostik Belousov <kostikbel at gmail.com>
None of the sigprocmask(2) code actually checks to see whether or
not the signal set is valid. This fixes that.
Thanks,
-Garrett
Index: compat-43/sigcompat.c
===================================================================
--- compat-43/sigcompat.c (revision 210226)
+++ compat-43/sigcompat.c (working copy)
@@ -163,7 +163,9 @@
int error;
sigemptyset(&set);
- sigaddset(&set, sig);
+ error = sigaddset(&set, sig);
+ if (error == -1)
+ return (SIG_ERR);
error = _sigprocmask(SIG_BLOCK, NULL, &pset);
if (error == -1)
return (SIG_ERR);
More information about the freebsd-hackers
mailing list