possible writes into area which is not allocated in a char array
>Submitter-Id: net
>Originator: Dheeraj Reddy
>Organization: Georgia Tech
>Confidential: no
>Synopsis: An expected segfault doesn't occur
>Severity: serious
>Priority: medium
>Category: c
>Class: accepts-illegal
>Release: 3.3 (Debian) (Debian testing/unstable)
>Environment:
System: Linux bharati 2.4.21-rc4 #1 Tue May 27 12:22:58 EDT 2003 i686 GNU/Linux
Architecture: i686
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux
>Description:
when i try to compile and run this code, it runs without any errors.
i am trying to access memory that i haven't allocated.
>How-To-Repeat:
==========================
#include <stdio.h>
int main (int argc,
char* argv[])
{
char buffer[4020];
int i;
for (i=0; i<=4028; i++)
buffer[i] = 'A';
return 0;
}
=======================
compiling and running this piece of code doesn;t seem to give me an
expected segmentation fault
>Fix:
i don't know.
Reply to: