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

Re: segfault when calling fclose(...)


seward@hplyot.obspm.fr (Anthony Seward) writes:

> Deep inside the innards of a certain library that I need to use, a call
> is made to fclose(FILE *stream) without first testing to see if 'stream'
> is a null pointer.  In the test program for the library one of
> the routines is invoked in such a way as to test the response of the
> system to a fclose(0x0) and ensure that the system responds with the
> proper error (as per man pages).

The argument given to fclose() must be a valid file handle.  NULL is
none and the glibc implementation does not test for this error in the
calling program.  Beside this, this is no problem with egcs so there
is no need to send this message to this list.

-- Uli
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


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