git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Derrick Stolee <stolee@gmail.com>
Cc: Derrick Stolee <dstolee@microsoft.com>,
	git@vger.kernel.org, peff@peff.net, christian.couder@gmail.com
Subject: Re: [PATCH v2] sha1_name: fix uninitialized memory errors
Date: Wed, 28 Feb 2018 13:06:54 -0800	[thread overview]
Message-ID: <xmqqr2p4kemp.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <ce8421bb-4519-c4e5-ff0a-98ae532d764b@gmail.com> (Derrick Stolee's message of "Wed, 28 Feb 2018 15:57:26 -0500")

Derrick Stolee <stolee@gmail.com> writes:

>> I do not think they are wrong, but aren't the latter two somewhat
>> redundant?  "num" is p->num_objects, and we call (first+1)th element
>> only after we see (first < num - 1), i.e. first+1 < num, and the
>> access to (first-1)th is done only when first > 0.  The first one,
>> i.e. when first points at where we _would_ find it if it existed,
>> can access "first" that could be p->num_objects, so the change there
>> makes sense, though.
>
> Yes. But I'd rather keep the blocks consistent and use the return
> value of nth_packed_object_oid() when possible.

Sure, I do not think anybody minds; I just wanted a sanity check.

Thansk.

      reply	other threads:[~2018-02-28 21:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  9:04 Use of uninitialised value of size 8 in sha1_name.c Christian Couder
2018-02-26  9:53 ` Jeff King
2018-02-26 10:23   ` Christian Couder
2018-02-26 14:06     ` Derrick Stolee
2018-02-26 14:43       ` Christian Couder
2018-02-26 14:56         ` [PATCH] sha1_name: fix uninitialized memory errors Derrick Stolee
2018-02-26 20:41           ` Jeff King
2018-02-27 11:47             ` [PATCH v2] " Derrick Stolee
2018-02-27 21:33               ` Jeff King
2018-02-27 22:30                 ` Junio C Hamano
2018-02-27 22:40                   ` Jeff King
2018-02-28 20:50               ` Junio C Hamano
2018-02-28 20:57                 ` Derrick Stolee
2018-02-28 21:06                   ` Junio C Hamano [this message]

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=xmqqr2p4kemp.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=stolee@gmail.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://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).