mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: open_memstream corner case
Date: Thu, 8 Oct 2015 18:12:56 -0400	[thread overview]
Message-ID: <20151008221256.GB8645@brightrain.aerifal.cx> (raw)
In-Reply-To: <5613D23A.3010707@gmail.com>

On Tue, Oct 06, 2015 at 04:52:58PM +0300, Maxim Storchak wrote:
> Hi,
> 
> I discovered something strange with memstream subsystem in musl: if a
> stream is opened for writing with open_memstream(3) but then closed
> without writing anything, neither buffer pointer, nor buffer size gets
> updated. I compared source code of glibc, uClibc and musl and discovered
> that both uClibc and musl update buffer size on write, while glibc does
> that on fclose or fsync, both of which is fine, according to
> memstream(3) man page. While both uClibc and musl behave the same if
> something is written to the buffer, they differ if no write happens. On
> initialization uClibc sets buffer size to 0, and musl leaves it intact.
> In case of no write it doesn't get updated and contains garbage. Here is
> my test case:

Thank you for the detailed report and test case. The bug should now be
fixed by commit 7b9f57f207b51132f188f750161953b7baf32154. Please let
me know if any problems remain or if you find other issues.

Here is the commit link in case you want to apply it manually to an
older version:

http://git.musl-libc.org/cgit/musl/commit/?id=7b9f57f207b51132f188f750161953b7baf32154

Rich


  reply	other threads:[~2015-10-08 22:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 13:52 Maxim Storchak
2015-10-08 22:12 ` Rich Felker [this message]
2015-10-13  8:43   ` Maxim Storchak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151008221256.GB8645@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).