I don't know how to make the program execute bash but I know how to cause a buffer overrun. Use the gets() function and a fixed-sized buffer. But I don't know how to make it execute the stack.
I thought a stack overflow meant that I ran out of memory. I still don't understand how someone can overflow a buffer and gain control of a computer. Wikipedia articles are so little help--when you read a Wikipedia article looking for something you do not understand you realize professional editors are very important.
When a program attempts to use more space than is available on the call stack (that is, when it attempts to access memory beyond the call stack's bounds, which is essentially a [[buffer overflow]]