[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHmME9oUH-RUJF_64e=4D+QDXgfQrmjHwyFm=9L-TEUtnsFWHQ@mail.gmail.com>
Date: Fri, 29 May 2015 17:21:44 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Frans Klaver <fransklaver@...il.com>
Cc: Dan Carpenter <dan.carpenter@...cle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
devel@...verdev.osuosl.org,
Shigekatsu Tateno <shigekatsu.tateno@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v3 1/4] ozwpan: Use proper check to prevent heap overflow
On Fri, May 29, 2015 at 2:36 PM, Frans Klaver <fransklaver@...il.com> wrote:
>
> I would say that it is because part of the expression has been placed
> inside parentheses:
>
> a - b + 1 == a - (b - 1)
>
> Guess it makes the decision logic slightly more readable.
Yes, exactly this. It's so that the bounding check conditional prior
looks identical to the actual subtraction, making it much easier to
read and verify.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists