Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Vulnerability Development: Re: Stack Allocations

Re: Stack Allocations

From: Jeff <lists_at_jeff.ath.cx>
Date: Mon, 9 Jul 2001 16:54:02 -0700

Hello,

I ran into the same question when I first discovered buffer overflow papers.
I asked around at the time and the most I could figure out was that it's
some kind of "pillow" of caution. Seems kinda strange to me too that the C
compiler gives you ANY leeway like that at all, but it does. I don't know
why, but I know that not many people know why either :)

Jeff
----- Original Message -----
From: <msoda_at_aspre.net>
To: <vuln-dev_at_securityfocus.com>
Sent: Monday, July 09, 2001 6:27 AM
Subject: Stack Allocations

> 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
>
>
>
Received on Jul 10 2001

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
edgeos