From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 19 05:10:09 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25EA21065674 for ; Mon, 19 Jul 2010 05:10:09 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id CF9348FC08 for ; Mon, 19 Jul 2010 05:10:08 +0000 (UTC) Received: by iwn35 with SMTP id 35so5312097iwn.13 for ; Sun, 18 Jul 2010 22:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=YcIL07Bh8bpcf2sNPvWy75nguMJIVtaDF62d0aDIVwQ=; b=Axl+l2jIs/yIcXp5t4q/LMNDL/BbKgJA8BC2d7Qs5XX3gZCjNTUwXexno78EmvhaYF Aq58C4yatx0c06/5TuvnB/UrX3iQoXBpOTp6NIJDupGOo3v0YgLAqYHflgK6Xt0VpdMO AKzTqubXHuCgGDFEmymjQ5V4FHP7L22c5KVJE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=v6xu1POvcNzv2A9kXbiurgBL/e41ct/GEVeC7H3NgYAlsUOfikLGh1vuDMrdFJtw9W kCEiQeKs8hWQkiJ1jBa3y+lh9yJmtZTz3THk8DUZwl+UKx0JXgfFMj+sHfpkSAKX3SfG tkerhzsn1gdpmTOpTS6rLKlIhsprMGJNIeu/c= MIME-Version: 1.0 Received: by 10.231.14.201 with SMTP id h9mr4496927iba.135.1279516208241; Sun, 18 Jul 2010 22:10:08 -0700 (PDT) Received: by 10.231.169.18 with HTTP; Sun, 18 Jul 2010 22:10:08 -0700 (PDT) In-Reply-To: References: Date: Sun, 18 Jul 2010 22:10:08 -0700 Message-ID: From: Garrett Cooper To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Kostik Belousov Subject: Fwd: [PATCH] Catch errors with sigaddset(3) in sigaddset (*sigset) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 05:10:09 -0000 CCing hackers@. ---------- Forwarded message ---------- From: Garrett Cooper Date: Sun, Jul 18, 2010 at 10:06 PM Subject: [PATCH] Catch errors with sigaddset(3) in sigaddset (*sigset) To: Kostik Belousov =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);