•If called as ./overflow
hello it runs fine
•If called as ./overflow
`perl –e ‘print “A”x600’` it segfaults due to an
overflow of the buffer
–// overflow.c
–#include <stdio.h>
–do_stuff(char *temp1) {
– char name[400];
– strcpy(name, temp1);
– printf(“Subroutine output: %s\n”,name);
–}
–main(int argc,char * argv[]) {
– do_stuff(argv[1]);
– printf(“Main output: %s\n”,argv[1]);
–}