This is the mail archive of the
insight-prs@sources.redhat.com
mailing list for the Insight project.
Re: insight/93: stdio.h problems : fopen() returns no adress unless file is called toto.txt !!!
- From: kseitz at sources dot redhat dot com
- To: fabien at obs dot univ-lyon1 dot fr, insight-prs at sourceware dot cygnus dot com, kseitz at sources dot redhat dot com, nobody at sourceware dot cygnus dot com
- Date: 4 Jan 2002 22:01:05 -0000
- Subject: Re: insight/93: stdio.h problems : fopen() returns no adress unless file is called toto.txt !!!
Synopsis: stdio.h problems : fopen() returns no adress unless file is called toto.txt !!!
Responsible-Changed-From-To: unassigned->kseitz
Responsible-Changed-By: kseitz
Responsible-Changed-When: Fri Jan 4 14:01:04 2002
Responsible-Changed-Why:
got it
State-Changed-From-To: open->closed
State-Changed-By: kseitz
State-Changed-When: Fri Jan 4 14:01:04 2002
State-Changed-Why:
Um.. Look at your program. It is doing exactly what it should be doing.
You're opening "toto.txt". When that file is not found, fopen returns NULL, which is then blindly passed to feof, which segfaults on the NULL.
What do you expect to happen? On my Red Hat linux 7.0 box, your program also crashes (with or without Insight).
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=93&database=insight