I've decided to take a little vacation from my regular programming and get back into hacking a bit as I have a little bit of free time now. So I'm studing program exploitation now, and will be doing so for probably the next few months.
So I have a small program I am exploiting with a buffer overflow attack. There's an array "char array[8]", which is the vulnerability because I can send data to it. In order for it to overflow, I need to send exactly 16 characters. However, this makes no sense to me because afaik, a char takes up one byte. Therefore I should only have to send 8 characters, but instead I have to send double that amount.
Could someone explain the reason I have to send this particular amount?
Thanks.
Edit:
After a bit more in depth reading and testing, I've discovered that when that line is run the compiler creates 16 bytes of space for the variable (sub $0x10, %rsp). So now I understand why I have to put 16 characters in, however I still don't get why it creates that much space.