[haiku-commits] Re: haiku: hrev53346 - src/add-ons/kernel/drivers/network/emulex_oce/dev/oce

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 06 Aug 2019 14:18:18 +0000

6 août 2019 16:16 "Rene Gollent" <anevilyak@xxxxxxxxx> a écrit:

On Tue, Aug 6, 2019 at 3:51 AM Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:

This doesn't really access anything yet, though; it just sets 'ii' to
something that would be out of bounds only if you'd actually try to
access it, which wasn't done yet. IOW it just pleases the tool.

Are you sure? If the array in question is near the edge of a page
boundary, overflowing it with an out of bounds access could certainly
lead to a read access violation. A corner case, I know, but not
impossible.

In this case we are just taking the address of an array cell, not actually
accessing the array. This is still:
1) Confusing
2) Undefined behavior

But still it should not result in a segfault because we access memory after the 
array.

-- 
Adrien.


Other related posts: