This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: (C++) memory overrun fix for arglist in lang_specific_driver


  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]