Received: by mail.netbsd.org (Postfix, from userid 605) id B278A84EF9; Sat, 10 Mar 2018 09:44:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 171E384ED8 for ; Sat, 10 Mar 2018 09:44:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id EtWGG3vRs3OO for ; Sat, 10 Mar 2018 09:44:47 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 9B8EC84ECC for ; Sat, 10 Mar 2018 09:44:47 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 86DCFFB40; Sat, 10 Mar 2018 09:44:47 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sat, 10 Mar 2018 09:44:47 +0000 From: "Eitan Adler" Subject: CVS commit: src/lib/libm/src To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20180310094447.86DCFFB40@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Eitan Adler" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: eadler Date: Sat Mar 10 09:44:47 UTC 2018 Modified Files: src/lib/libm/src: e_atan2.c Log Message: Fix signed overflow in atan2 As a component of atan2(y, x), the case of x == 1.0 is farmed out to atan(y). The current implementation of this comparison is vulnerable to signed integer underflow (that is, undefined behavior), and it's performed in a somewhat more complicated way than it need be. Change it to not be quite so cute, rather directly comparing the high/low bits of x to the specific IEEE-754 bit pattern that encodes 1.0. ok martin@ pgoyette@ maya@ obtained from FreeBSD To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/libm/src/e_atan2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.