This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: binutils and _FORTIFY_SOURCE
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Anthony Green <green at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 21 Nov 2005 08:36:46 +1030
- Subject: Re: binutils and _FORTIFY_SOURCE
- References: <1132508804.2976.53.camel@localhost.localdomain>
On Sun, Nov 20, 2005 at 09:46:44AM -0800, Anthony Green wrote:
> typedef struct
> {
> char foo[4];
> int bar;
> } mystruct;
>
> we see code kind of like...
>
> mystruct s;
> strcpy (s.foo, "1234"); /* buffer overflow here */
> s.bar = 5; /* but it doesn't really matter */
>
> Has anybody looked into this before?
> Will you accept patches to remove false _FORTIFY_SOURCE errors?
Yes. The above really ought to be using memcpy.
--
Alan Modra
IBM OzLabs - Linux Technology Centre