git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Jeff King'" <peff@peff.net>
Cc: <git@vger.kernel.org>
Subject: RE: [Possible Bug] Use of write on size-limited platforms
Date: Fri, 19 Jun 2020 11:05:52 -0400	[thread overview]
Message-ID: <028c01d6464b$235346c0$69f9d440$@nexbridge.com> (raw)
In-Reply-To: <20200616080200.GA650578@coredump.intra.peff.net>

On June 16, 2020 4:02 AM, Peff wrote:
> To: Randall S. Becker <rsbecker@nexbridge.com>
> Cc: git@vger.kernel.org
> Subject: Re: [Possible Bug] Use of write on size-limited platforms
> 
> On Mon, Jun 15, 2020 at 06:38:34PM -0400, Randall S. Becker wrote:
> 
> > > So I think this really ought to be using write_in_full(). There's
> > > only one caller, and I think it would be improved by the switch. Do
> > > you want to write a patch?
> > >
> > > You could make an argument that the fwrite() version ought to also
> > > loop, since it's possible to get a partial write there, too. But we
> > > don't do that in general. I suspect in practice most stdio
> > > implementations will keep writing until they see an error, and most
> > > callers don't bother checking stdio errors at all, or use ferror().
> >
> > I'll give the patch a go. It is very simple. Would you suggest
> > removing the strbuf_write_fd() as part of this patch since it only
> > impacts bugreport.c?
> 
> I could go either way on that. IMHO it isn't offering much over a bare
> write_in_full() call. The "don't call write() if there are 0 bytes"
> logic is part of write_in_full() already.

Patch delivered.

Regards,
Randall


  reply	other threads:[~2020-06-19 16:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 21:41 [Possible Bug] Use of write on size-limited platforms Randall S. Becker
2020-06-15 21:59 ` Jeff King
2020-06-15 22:38   ` Randall S. Becker
2020-06-16  8:02     ` Jeff King
2020-06-19 15:05       ` Randall S. Becker [this message]
2020-06-19 19:35         ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='028c01d6464b$235346c0$69f9d440$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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://80x24.org/mirrors/git.git

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).