This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: (C++) memory overrun fix for arglist in lang_specific_driver
- To: Mumit Khan <khan at xraylith dot wisc dot EDU>
- Subject: Re: (C++) memory overrun fix for arglist in lang_specific_driver
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 23 Aug 1999 22:32:40 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <199908171710.MAA27878@mercury.xraylith.wisc.edu>you write:
> The following fixes a memory overrun problem in arglist. The problem is
> that the num_args doesn't leave room for the final NULL, and the problem
> shows up on platforms where MATH_LIBRARY is "" and hence need_math is
> 0.
>
> Easy way to reproduce is the following:
>
> $ ./g++ -B./ -c -v foo.c
>
> on a platform where MATH_LIBRARY is "" (such as x86-mingw32).
>
> Tue Aug 17 12:04:14 1999 Mumit Khan <khan@xraylith.wisc.edu>
>
> * g++spec.c (lang_specific_driver): Add room for NULL in arglist.
Thanks. I installed this change.
However, looking at cppspec.c and f/g77spec.c I think they have a similar
problem -- I do do see where they allocate a argv slot for the last null
argument, nor I do see how they initialize that slot to NULL.
Can you take a peek at them and verify that I didn't miss something stupid?
[ Or if Zack & Craig want to verify that's cool too. ]
jeff