[Bug stdio/10108] setvbuf _IOFBF doesn't honor size correctly

fche at redhat dot com sourceware-bugzilla@sourceware.org
Sun Jun 22 04:11:00 GMT 2014


https://sourceware.org/bugzilla/show_bug.cgi?id=10108

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #5 from Frank Ch. Eigler <fche at redhat dot com> ---
The problem is this block in libio/iosetvbuf.c:

  switch (mode)
    {
    case _IOFBF:
      fp->_IO_file_flags &= ~(_IO_LINE_BUF|_IO_UNBUFFERED);
      if (buf == NULL)
        {
          if (fp->_IO_buf_base == NULL)
              if (_IO_DOALLOCATE (fp) < 0)
                {
                  result = EOF;
                  goto unlock_return;
                }
              fp->_IO_file_flags &= ~_IO_LINE_BUF;
            }
          result = 0;
          goto unlock_return;
        }
      break;

Note specifically how _IO_DOALLOCATE (fp) is called,
without any reference for the incoming size value.
(_IO_DOALLOCATE uses the block size of the underlying
filesystem.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list