Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752782AbZKLNXs (ORCPT ); Thu, 12 Nov 2009 08:23:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752598AbZKLNXr (ORCPT ); Thu, 12 Nov 2009 08:23:47 -0500 Received: from mail-vw0-f192.google.com ([209.85.212.192]:53580 "EHLO mail-vw0-f192.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752591AbZKLNXq convert rfc822-to-8bit (ORCPT ); Thu, 12 Nov 2009 08:23:46 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=wMZSsrpfwtb9A5imbinLOcJ/JZcd6kwb2a7YkDZBoFagydJgTUj481Zn1Xeqke3Ios YePnshQ1jN2AMtSRB54EiKlTfuRlYlbGQHKMmuLE/OgsMWaxtCFJJiZLfDB333VHTzyr vnIjHLy/9D0N/TJXbWqQPWQQhsoHd4O41ODD0= MIME-Version: 1.0 In-Reply-To: <200911122336.11033.rusty@rustcorp.com.au> References: <2bd27b061789ed14dd80816fd987273ae33ffbd1.1257864802.git.andre.goddard@gmail.com> <200911122336.11033.rusty@rustcorp.com.au> From: =?ISO-8859-1?Q?Andr=E9_Goddard_Rosa?= Date: Thu, 12 Nov 2009 11:23:32 -0200 Message-ID: Subject: Re: [PATCH v4 2/2] bsearch: prevent overflow when computing middle comparison element To: Rusty Russell Cc: tabbott@ksplice.com, alan-jenkins@tuffmail.co.uk, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 872 Lines: 20 On Thu, Nov 12, 2009 at 11:06 AM, Rusty Russell wrote: > On Wed, 11 Nov 2009 01:30:25 am Andr? Goddard Rosa wrote: >> It's really difficult to occur in practice because the sum of the lower >> and higher limits must overflow an int variable, but it can occur when >> working with large arrays. We'd better safe than sorry by avoiding this >> overflow situation when computing the middle element for comparison. > > I applied all these, after testing. ?In future would have been nice for you > to have posted a test patch so I didn't have make my own... > Sure, no problem, thanks! Kind regards, Andr? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/