lkml.org 
[lkml]   [2004]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux-2.4.22 memory overwriting
On Sun, Feb 01, 2004 at 01:14:37PM +0100, Julien Rebetez wrote:
> Hi !
> I've writen the following program :
[snip]
> Should I not get a SIGSEV from the system ? Isn't it dangerous to allow
> the user to put 5 elements in a 4 elements tab?

This is nothing to do the the kernel. It's to do with C.

Yes, it is dangerous to allow this behaviour. However, C doesn't
perform bounds checking on arrays -- this is left to the programmer to
ensure that an array is never accessed outside its bounds. The effects
of accessing (reading or writing) an array outside its bounds are
undefined. In this case, it's worked. In other situations, with
different arrays, it may not work.

Nothing to see here. Move along.

Hugo.

--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 1C335860 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- Well, you don't get to be a kernel hacker simply by looking ---
good in Speedos. -- Rusty Russell
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.179 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site