This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Potential Ada tweak: those who know ada please comment.
On Fri, 2002-11-15 at 18:18, Nathanael Nerode wrote:
> Zack Weinberg wrote:
> > The actual length of the buffer is __gnat_max_path_len-1 bytes (since
> > these C routines require one byte for a terminator), so the _proper_
> > fix would look more like
> >
> > tmpdir = getenv (TMPDIR);
> > tmplen = strlen (tmplen);
> >
> > if (tmplen + sizeof "/gnat-XXXXXX" >= __gnat_max_path_len)
> > // signal an error
> >
> > sprintf(tmp_filename, "%s/gnat-XXXXXX", tmpdir); // now safe
> >
> > zw
> >
> >
> OK, someone please write a patch which is correct and commit it as
> obvious. *rolls eyes* Maybe I'll reopen the bug. This type of
> material is so not my field.
I'll try to bodge something together in the near future.
Thinking about it a bit more, the truly correct fix requires us to get
the Ada runtime library the hell out of gcc/ada into its own directory,
and give it an autoconf script. Because
#ifndef __linux__
/* security hole */
#endif
is just inappropriate.
zw