This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11082] fclose(f); ftell(f); results in accesses on free'd memory
- From: "pasky at suse dot cz" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 11 Dec 2009 13:24:48 -0000
- Subject: [Bug libc/11082] fclose(f); ftell(f); results in accesses on free'd memory
- References: <20091211102154.11082.jur.pauw@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From pasky at suse dot cz 2009-12-11 13:24 -------
Not really, file descriptor is something different from file stream. Something
can close the file descriptor while keeping the stream alive (e.g. by obtaining
it from stream using fileno() or by mass-closing all file descriptors), then
this error would trigger.
But if you close the stream itself, there's no stream _of_ the underlying file
descriptor. After you fclose(), the FILE* value is totally invalid and you must
not use it anymore.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |INVALID
http://sourceware.org/bugzilla/show_bug.cgi?id=11082
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.