All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Joey Hess <id@joeyh.name>
Subject: Re: [PATCH] convert: avoid malloc of original file size
Date: Fri, 08 Mar 2019 10:26:24 +0900	[thread overview]
Message-ID: <xmqqa7i6kvgf.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190307195657.GA29776@sigill.intra.peff.net> (Jeff King's message of "Thu, 7 Mar 2019 14:56:57 -0500")

Jeff King <peff@peff.net> writes:

> As discussed there, I do think this only solves half the problem, as the
> smudge filter has the same issue in reverse. That's more complicated to
> fix, and AFAIK nobody is working on it. But I don't think there's any
> reason not to pick up this part in the meantime.

Yeah, I agree that the reverse direction shares the same issue.

I am not sure 0 is a good initial value in this direction, either;
I'd rather clip to min(len, core.bigfilethreshold) or something like
that, to avoid regressing the more normal use cases.  

But let's queue this and see what happens.

Thanks.

>
>  convert.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/convert.c b/convert.c
> index 5d0307fc10..94ff837649 100644
> --- a/convert.c
> +++ b/convert.c
> @@ -731,7 +731,7 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le
>  	if (start_async(&async))
>  		return 0;	/* error was already reported */
>  
> -	if (strbuf_read(&nbuf, async.out, len) < 0) {
> +	if (strbuf_read(&nbuf, async.out, 0) < 0) {
>  		err = error(_("read from external filter '%s' failed"), cmd);
>  	}
>  	if (close(async.out)) {

  reply	other threads:[~2019-03-08  1:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 19:56 [PATCH] convert: avoid malloc of original file size Jeff King
2019-03-08  1:26 ` Junio C Hamano [this message]
2019-03-08  2:52   ` Jeff King

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=xmqqa7i6kvgf.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=id@joeyh.name \
    --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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.