From owner-freebsd-current Sat Nov 16 4:18:59 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EEB9437B401; Sat, 16 Nov 2002 04:18:57 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9148643E4A; Sat, 16 Nov 2002 04:18:56 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id XAA08587; Sat, 16 Nov 2002 23:18:42 +1100 Date: Sat, 16 Nov 2002 23:31:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Julian Elischer Cc: Nate Lawson , Tim Robbins , FreeBSD current users Subject: Re: Sign fixes for disklabel(8) In-Reply-To: Message-ID: <20021116232441.H18454-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 16 Nov 2002, Julian Elischer wrote: > On Fri, 15 Nov 2002, Nate Lawson wrote: > > In the overflow case, strtoul returns ULONG_MAX. Or if you're interested > > in catching invalid characters, use endptr. > > I'm not that interested in catching those cases.. they were not caught > before and I'm looking for the minimal diff.. > > I've just removed the clause. See new patch attached.. Removing clauses gives maximal diffs and loses even some of the sub-minimal bounds checking (values less than 0 were just errors in some cases, but they are now converted to large unsigned values and not checked at all). > A sensible thing might be to compare against a "sensible" value > but who knows what that value should be? Values should only be restricted to avoid ones that can't possibly work. This is mostly already done. > I include the new diff for your coments I'll wait for a later one with more of the suggested changes incorporated (strtoul() should use base 10, and most things shouldn't be changed, etc.). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message