From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 11:12:56 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97746106567E; Mon, 21 Jun 2010 11:12:56 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 15A928FC13; Mon, 21 Jun 2010 11:12:55 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.4/8.14.4) with ESMTP id o5LBCsAr032215; Mon, 21 Jun 2010 15:12:54 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1277118774; bh=DtPuBhDy5dPwiEknoEAy4zXGkgqT9MSwmF/Fvtd4Hs8=; l=379; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=itRubeOCLPL8DaiNMSx1vvwQiSAIWMFEoaz9DuhInARF0fm+W1urSv47VDICDL6vx luSXcQ//PQBq5OrSOIrnRPTw8Qo8ULurVHEVd13eBiC5mZtfKBP7JRJpKUjuRLLaUC QkPvBCEzq+A5IaRtDgsdZb/GOCiGvYiUjal329X4= Received: (from ache@localhost) by nagual.pp.ru (8.14.4/8.14.4/Submit) id o5LBCsEH032214; Mon, 21 Jun 2010 15:12:54 +0400 (MSD) (envelope-from ache) Date: Mon, 21 Jun 2010 15:12:54 +0400 From: Andrey Chernov To: "Andrey V. Elsukov" Message-ID: <20100621111254.GA31917@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , "Andrey V. Elsukov" , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201006210824.o5L8OpFD067283@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006210824.o5L8OpFD067283@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r209388 - in head/sbin/geom: class/part core misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 11:12:56 -0000 On Mon, Jun 21, 2010 at 08:24:51AM +0000, Andrey V. Elsukov wrote: > +done: > + if (mult * unit < mult || number * mult * unit < number) > + return (ERANGE); A general rule is: don't check for overflow when it already occurs, since result can be any, including valid ones. Redo it to before overflow stage (using things like OFF_MAX / unit). -- http://ache.pp.ru/