This is the mail archive of the gcc-bugs@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]

problem in g77 inqure


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)]


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