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.
- From: Geert Bosch <bosch at gnat dot com>
- To: Nathanael Nerode <neroden at twcny dot rr dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 16 Nov 2002 21:31:08 -0500 (EST)
- Subject: 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