This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: segfault when calling fclose(...)
- To: egcs at cygnus dot com
- Subject: Re: segfault when calling fclose(...)
- From: Ulrich Drepper <drepper at cygnus dot com>
- Date: 29 Mar 1998 16:34:05 -0800
- Newsgroups: cygnus.egcs
- Organization: Cygnus Solutions
- References: <199803271435.PAA03330.cygnus.egcs@horatio.obspm.fr>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
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 `------------------------