From: Julien Rebetez <julien.r@bluewin.ch>
To: linux-kernel@vger.kernel.org
Subject: Linux-2.4.22 memory overwriting
Date: Sun, 01 Feb 2004 13:14:37 +0100 [thread overview]
Message-ID: <401CEDAD.70601@bluewin.ch> (raw)
Hi !
I've writen the following program :
#include <stdio.h>
int main ()
{
int p[4];
p[0]=1;
p[1]=2;
p[2]=3;
p[3]=4;
p[4]=5;
printf ("%i, %i, %i, %i, %i\n", p[0], p[1], p[2], p[3],
p[4]);
return 0;
}
I compile it with :
gcc -o test test.c -Wall
and when i launch it, the output is :
julien:$> ./test
1, 2, 3, 4, 5
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?
(tested on Linux 2.4.22 on a i686)
Thanks
next reply other threads:[~2004-02-01 12:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-01 12:14 Julien Rebetez [this message]
2004-02-01 12:21 ` Linux-2.4.22 memory overwriting Hugo Mills
2004-02-01 12:33 ` Roberto Sanchez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=401CEDAD.70601@bluewin.ch \
--to=julien.r@bluewin.ch \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox