Potential Ada tweak: those who know ada please comment.

Nathanael Nerode neroden@twcny.rr.com
Fri Nov 15 17:34:00 GMT 2002


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.

--Nathanael

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



More information about the Gcc-patches mailing list