Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jul 2010 22:10:08 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        hackers@freebsd.org
Cc:        Kostik Belousov <kostikbel@gmail.com>
Subject:   Fwd: [PATCH] Catch errors with sigaddset(3) in sigaddset (*sigset)
Message-ID:  <AANLkTimiaHZ_cBykjPXr2tev3vBTHN-uO-riHepBrEi4@mail.gmail.com>
In-Reply-To: <AANLkTilPpmzhb39E-R2ni3p2l4KR1kaeNS-EZJvbK6fE@mail.gmail.com>
References:  <AANLkTilPpmzhb39E-R2ni3p2l4KR1kaeNS-EZJvbK6fE@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
CCing hackers@.

---------- Forwarded message ----------
From: Garrett Cooper <yanegomi@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@gmail.com>

=A0 =A0None 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- compat-43/sigcompat.c =A0 =A0 =A0 (revision 210226)
+++ compat-43/sigcompat.c =A0 =A0 =A0 (working copy)
@@ -163,7 +163,9 @@
=A0 =A0 =A0 =A0int error;

=A0 =A0 =A0 =A0sigemptyset(&set);
- =A0 =A0 =A0 sigaddset(&set, sig);
+ =A0 =A0 =A0 error =3D sigaddset(&set, sig);
+ =A0 =A0 =A0 if (error =3D=3D -1)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (SIG_ERR);
=A0 =A0 =A0 =A0error =3D _sigprocmask(SIG_BLOCK, NULL, &pset);
=A0 =A0 =A0 =A0if (error =3D=3D -1)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (SIG_ERR);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimiaHZ_cBykjPXr2tev3vBTHN-uO-riHepBrEi4>