All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org, "Martin Ågren" <martin.agren@gmail.com>,
	"Jeff King" <peff@peff.net>
Subject: Re: [PATCH v2 0/5] tree-walk object_id refactor
Date: Tue, 15 Jan 2019 09:51:54 -0800	[thread overview]
Message-ID: <xmqq8szlu7ut.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190115003946.932078-1-sandals@crustytoothpaste.net> (brian m. carlson's message of "Tue, 15 Jan 2019 00:39:40 +0000")

"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> There are a small number of places in our codebase where we cast a
> buffer of unsigned char to a struct object_id pointer. When we have
> GIT_MAX_RAWSZ set to 32 (because we have SHA-256), one of these places
> (the buffer for tree objects) can lead to us copying too much data when
> using SHA-1 as the hash, since there are only 20 bytes to read.

Thanks.  And thanks for a pleasant-to-follow discussion during the
review of the previous round.

> Changes from v1:
> * Use hashcpy instead of memcpy.
> * Adopt Peff's suggestion for improving patch 3.
>
> brian m. carlson (5):
>   tree-walk: copy object ID before use
>   match-trees: compute buffer offset correctly when splicing
>   match-trees: use hashcpy to splice trees
>   tree-walk: store object_id in a separate member
>   cache: make oidcpy always copy GIT_MAX_RAWSZ bytes
>
>  builtin/grep.c                     |  8 ++++----
>  builtin/merge-tree.c               | 20 ++++++++++----------
>  builtin/pack-objects.c             |  4 ++--
>  builtin/reflog.c                   |  4 ++--
>  cache-tree.c                       |  4 ++--
>  cache.h                            |  2 +-
>  contrib/coccinelle/object_id.cocci | 30 ------------------------------
>  delta-islands.c                    |  2 +-
>  fsck.c                             |  4 ++--
>  http-push.c                        |  4 ++--
>  list-objects.c                     |  6 +++---
>  match-trees.c                      | 27 ++++++++++++++++++++-------
>  notes.c                            |  4 ++--
>  packfile.c                         |  2 +-
>  revision.c                         |  4 ++--
>  tree-diff.c                        |  6 +++---
>  tree-walk.c                        | 21 ++++++++++++---------
>  tree-walk.h                        |  9 ++++++---
>  tree.c                             | 10 +++++-----
>  unpack-trees.c                     |  6 +++---
>  walker.c                           |  4 ++--
>  21 files changed, 85 insertions(+), 96 deletions(-)

  parent reply	other threads:[~2019-01-15 17:52 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 23:34 What's cooking in git.git (Jan 2019, #01; Mon, 7) Junio C Hamano
2019-01-08  9:50 ` tg/checkout-no-overlay, was " Thomas Gummerer
2019-01-08 17:51   ` Junio C Hamano
2019-01-08 17:30 ` ag/sequencer-reduce-rewriting-todo " Alban Gruin
2019-01-08 21:20 ` sb/more-repo-in-api, was " Jonathan Tan
2019-01-08 21:35   ` Junio C Hamano
2019-01-09 21:28     ` Stefan Beller
2019-01-09  7:37 ` Martin Ågren
2019-01-09 21:06   ` Martin Ågren
2019-01-10  1:02     ` brian m. carlson
2019-01-10 18:55       ` Junio C Hamano
2019-01-10 19:03       ` Martin Ågren
2019-01-10  4:25     ` [PATCH 0/5] tree-walk object_id refactor brian m. carlson
2019-01-10  4:25       ` [PATCH 1/5] tree-walk: copy object ID before use brian m. carlson
2019-01-10  4:25       ` [PATCH 2/5] match-trees: compute buffer offset correctly when splicing brian m. carlson
2019-01-10  4:25       ` [PATCH 3/5] match-trees: use hashcpy to splice trees brian m. carlson
2019-01-10  6:45         ` Jeff King
2019-01-10 23:55           ` brian m. carlson
2019-01-11 14:51             ` Jeff King
2019-01-11 14:54               ` Jeff King
2019-01-14  1:30                 ` brian m. carlson
2019-01-14 15:40                   ` Jeff King
2019-01-10  4:25       ` [PATCH 4/5] tree-walk: store object_id in a separate member brian m. carlson
2019-01-10  6:49         ` Jeff King
2019-01-10 23:57           ` brian m. carlson
2019-01-10  4:25       ` [PATCH 5/5] cache: make oidcpy always copy GIT_MAX_RAWSZ bytes brian m. carlson
2019-01-10  6:50         ` Jeff King
2019-01-10  6:40       ` [PATCH 0/5] tree-walk object_id refactor Jeff King
2019-01-11  0:17         ` brian m. carlson
2019-01-11 14:17           ` Jeff King
2019-01-15  0:39     ` [PATCH v2 " brian m. carlson
2019-01-15  0:39       ` [PATCH v2 1/5] tree-walk: copy object ID before use brian m. carlson
2019-01-15  0:39       ` [PATCH v2 2/5] match-trees: compute buffer offset correctly when splicing brian m. carlson
2019-01-15  0:39       ` [PATCH v2 3/5] match-trees: use hashcpy to splice trees brian m. carlson
2019-01-15  0:39       ` [PATCH v2 4/5] tree-walk: store object_id in a separate member brian m. carlson
2019-01-15  0:39       ` [PATCH v2 5/5] cache: make oidcpy always copy GIT_MAX_RAWSZ bytes brian m. carlson
2019-01-15 17:51       ` Junio C Hamano [this message]
2019-01-09 10:28 ` What's cooking in git.git (Jan 2019, #01; Mon, 7) Jeff King
2019-01-10 19:05   ` Junio C Hamano
2019-01-10 19:46   ` Junio C Hamano
2019-01-10 18:02 ` Stefan Beller

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=xmqq8szlu7ut.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=martin.agren@gmail.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.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.