This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
problem in g77 inqure
- To: gcc-bugs at gcc dot gnu dot org
- Subject: problem in g77 inqure
- From: yoshinari dot hayato at kek dot jp
- Date: Wed, 15 Dec 1999 04:57:52 +0900
Dear maintainers,
I've experienced a problem in using inqure statement.
If the length of the filename is larger than 256,
the buffer overrun will occurr in the function
f_inqu(libf2c/libI77/inquire.c).
I'm not sure it's good or not but I attach my personal
fix.(This fix will discard some characters if the string
for the filename is too long.)
diff ./inquire.c inquire.c.new
23,24c23,26
< { byfile=1;
< g_char(a->infile,a->infilen,buf);
---
> { int actual_len;
> actual_len = (a->infilen>255)?256:a->infilen;
> byfile=1;
> g_char(a->infile,actual_len,buf);
(Same kind of problem occurs in open statement.)
Regards,
Yoshinari Hayato
---
Yoshinari Hayato / yoshinari.hayato@kek.jp
High Energy Accelerator Research Organization (KEK)
Institute of Particle and Nuclear Studies (IPNS)
Tel:(+81)-298-64-5387 (dial-in) / Fax:(+81)-298-64-7831
[ 090-1-858-8544 (IDO)]