Vulnerability Development mailing list archives
Stack Allocations
From: <msoda () aspre net>
Date: Mon, 9 Jul 2001 09:27:10 -0400 (EDT)
Hey all, I have been reading up on buffer overflows and have noticed something odd with gcc assembly output. Consider the following: void func() { char buf[15]; } main() { func(); } When running 'gcc -S' it shows that 24 bytes are allocated on the stack for buf[]. I thought it should allocate only 16 bytes. It works fine, it just makes no sense to me. If I tweak the assembly and change it to 16 bytes and also change the offsets to %ebp that reference it, it works fine also. Does anyone know why gcc does this? My need to understand everything is killing me! -Marc
Current thread:
- Stack Allocations msoda (Jul 09)
- Re: Stack Allocations Andrew Barros (Jul 12)
- Re: Stack Allocations Marc Soda (Jul 13)
- Re: Stack Allocations wwieser (Jul 14)
- <Possible follow-ups>
- Re: Stack Allocations Jeff (Jul 10)
- Re: Stack Allocations Andrew Barros (Jul 12)