[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesnt work?



In-Reply-To: <200310071356.PAA26163@xxxxxxxxxxxxx>

overflowing this example program does not follow the same rules as a "standard stack overflow".  as it is not inside a sub-function, and is overflowing in main(){}...

>// foo.c, vuln proggy
>// compile gcc -o foo foo.c
>// 
>
>#include <stdio.h>
>#include <string.h> 
>
>main (int argc,char **argv){ 
>
>char buffer[1024]; 
>
>if (!argc) {
>    fprintf(stdout,"No argument found.");
>    exit(-1);
>    } 
>
>strcpy(buffer,argv[1]); 
>
>}