public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12527] New: Off by one bug with ftell() with fmemopen()
@ 2011-03-01 19:59 per.mathisen at gmail dot com
  2011-03-01 20:09 ` [Bug libc/12527] " per.mathisen at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: per.mathisen at gmail dot com @ 2011-03-01 19:59 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-06-27 13:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-01 19:59 [Bug libc/12527] New: Off by one bug with ftell() with fmemopen() per.mathisen at gmail dot com
2011-03-01 20:09 ` [Bug libc/12527] " per.mathisen at gmail dot com
2011-03-01 20:12 ` per.mathisen at gmail dot com
2011-03-03 11:58 ` schwab@linux-m68k.org
2011-03-03 20:17 ` dflahert at us dot ibm.com
2011-03-03 21:28 ` per.mathisen at gmail dot com
2011-03-06  4:13 ` drepper.fsp at gmail dot com
2011-03-07 21:04 ` per.mathisen at gmail dot com
2011-03-12 21:46 ` per.mathisen at gmail dot com
2011-05-12  3:45 ` drepper.fsp at gmail dot com
2014-06-27 13:48 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).