Hello everyone i have a little problem and i am looking forward for someone to tell me how to solve it.

I am reading shellcoder's handbook and i am just getting the message:
Segmentation fault

How can i fix it.
#include <stdio.h>
#include <string.h>
void return_input (void)
{
char array[30];
gets (array);
printf("%s\n", array);
}
main()
{
return_input();
return 0;
}
the shellcode
printf "AACDDDDAAAAAAAAAABBBBBBBBBAAAAAA\x05\x84\x04\ x08" | ./overflow
and the assembly core dump
Dump of assembler code for function main:
0x08048402 <main+0>: push %ebp
0x08048403 <main+1>: mov %esp,%ebp
0x08048405 <main+3>: call 0x80483e4 <return_input>
0x0804840a <main+8>: mov $0x0,%eax
0x0804840f <main+13>: pop %ebp
0x08048410 <main+14>: ret
End of assembler dump.
I have tried turning off ASLR but no luck.