This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12527] New: Off by one bug with ftell() with fmemopen()
- From: "per.mathisen at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Tue, 1 Mar 2011 19:59:26 +0000
- Subject: [Bug libc/12527] New: Off by one bug with ftell() with fmemopen()
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=12527
Summary: Off by one bug with ftell() with fmemopen()
Product: glibc
Version: 2.12
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper.fsp@gmail.com
ReportedBy: per.mathisen@gmail.com
Created attachment 5269
--> http://sourceware.org/bugzilla/attachment.cgi?id=5269
Program that fails
The attached tiny program assert fails on ftell(fp) == ftell(fp), which it
seems to me should always work. I only get this problem with file pointers
created with fmemopen and the "r+" mode, and only with sequences of events
similar to those in the attached file. The ftell() seems to always returns 1
less than the actual size when it fails.
There also seems to be an issue with fmemopen() when used with the "r+" mode if
the input buffer is not zero cleared. See comment in attachment.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.