Re: grammar tool bug

Bug fixed. Thanks for the report.

Vincent.

Fox One wrote:
>
> There is a bug in `Amaya/batch/grammar.c' on
> lines 870 and 871. These lines read as follows:
> 
> 869                  /* cree le fichier .LST */
> 870                  listFile = fopen (fileName, "w");
> 871                  fprintf (listFile, "GRAMMAR OF
> FILE ");
> 872                  i = 0;
> 873                  while (fileName[i] != '.')
> 874                    putc (fileName[i++], listFile);
> 
> The return value from `fopen()' is not checked
> for failure. If the user doesn't have permission
> to write the to list file, `fopen()' will fail
> (returning null).
> 
> On my system (LINUX-ELF), the call to `fprintf()'
> on line 871 doesn't produce a segfault for some
> reason, but the segfault does occur on line 874 --
> when `putc()' is called.
> 
> The return values for `fopen' and `malloc' should
> *always* be checked for possible failure.
> 
> I discovered this problem when trying to compile
> Amaya as a different user from the user that
> checked out the working directory.
> 
> Another (related) problem, is that, even if you
> build Amaya in a directory that is different from the
> working directory, the build process wants to write
> into the working directory anyway.
> 
-------------------------------------------------------
Vincent Quint                       INRIA Rhone-Alpes
W3C/INRIA                           ZIRST
e-mail: Vincent.Quint@w3.org        655 avenue de l'Europe
Tel.: +33 4 76 61 53 62             38330 Montbonnot St Martin
Fax:  +33 4 76 61 52 07             France

Received on Monday, 3 July 2000 04:36:54 UTC