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]
Other format: [Raw text]

Re: Potential Ada tweak: those who know ada please comment.


I don't think this patch has anything to do with Ada knowledge.
Still, it does look correct to me.

On Fri, 15 Nov 2002, Nathanael Nerode wrote:

  I was told that this is in fact the correct way to solve the buffer
  overflow problem.  What do I know?  Nothing.  So I'm throwing it to the list.
  
  Index: adaint.c
  ===================================================================
  RCS file: /cvs/gcc/gcc/gcc/ada/adaint.c,v
  retrieving revision 1.12
  diff -u -r1.12 adaint.c
  --- adaint.c	13 Nov 2002 21:48:22 -0000	1.12
  +++ adaint.c	16 Nov 2002 01:32:43 -0000
  @@ -709,7 +709,7 @@
     if (tmpdir == NULL)
       strcpy (tmp_filename, "/tmp/gnat-XXXXXX");
     else
  -    sprintf (tmp_filename, "%200s/gnat-XXXXXX", tmpdir);
  +    sprintf (tmp_filename, "%.200s/gnat-XXXXXX", tmpdir);
   
     close (mkstemp(tmp_filename));
   #else
  


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