git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Martin Ågren" <martin.agren@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] fsck: avoid looking at NULL blob->object
Date: Sat, 9 Jun 2018 15:44:30 +0200	[thread overview]
Message-ID: <CAN0heSqkcZ5KBpaq7R45A7wPxQ3F=6PKeHqwAQztdJyz31Vdwg@mail.gmail.com> (raw)
In-Reply-To: <20180609092135.GC6817@sigill.intra.peff.net>

On 9 June 2018 at 11:21, Jeff King <peff@peff.net> wrote:
> On Sat, Jun 09, 2018 at 10:50:36AM +0200, Martin Ågren wrote:
>
>> On 9 June 2018 at 10:32, Jeff King <peff@peff.net> wrote:
>> > Except it _does_ do one non-trivial thing, which is call the
>> > report() function, which wants us to pass a pointer to a
>> > "struct object". Which we don't have (we have only a "struct
>> > object_id"). So we erroneously passed the NULL object, which
>>
>> s/passed/dereferenced/? Probably doesn't affect the fix though.
>
> Well, we passed it, and then that function dereferenced it. :)
>
> I'm going to re-roll for the minor bits that Eric pointed out, so I'll
> try to word this better.

My bad. I somehow thought we get into trouble already before we call
`report()`. Well, we do, since we have undefined behavior. But for all
practical purposes `&blob->object` and `blob` are the same
(NULL-)pointer so we only crash after we call `report()`.

Anyway, obviously no need to do anything about this in a v3.

Martin

  reply	other threads:[~2018-06-09 13:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-09  8:32 [PATCH] fsck: avoid looking at NULL blob->object Jeff King
2018-06-09  8:38 ` Eric Sunshine
2018-06-09  9:19   ` Jeff King
2018-06-09  8:45 ` Duy Nguyen
2018-06-09  9:20   ` Jeff King
2018-06-09  8:50 ` Martin Ågren
2018-06-09  9:21   ` Jeff King
2018-06-09 13:44     ` Martin Ågren [this message]
2018-06-12  9:51       ` Jeff King
2018-06-09  9:30 ` [PATCH v2 0/2] .gitmodules fsck cleanups Jeff King
2018-06-09  9:31   ` [PATCH v2 1/2] t7415: don't bother creating commit for symlink test Jeff King
2018-06-09  9:46     ` SZEDER Gábor
2018-06-11  8:35       ` [PATCH v3 0/2] .gitmodules fsck cleanups Jeff King
2018-06-11  8:35         ` [PATCH v3 1/2] t7415: don't bother creating commit for symlink test Jeff King
2018-06-11  8:35         ` [PATCH v3 2/2] fsck: avoid looking at NULL blob->object Jeff King
2018-06-09  9:31   ` [PATCH v2 " Jeff King
2018-06-09  9:50     ` SZEDER Gábor

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='CAN0heSqkcZ5KBpaq7R45A7wPxQ3F=6PKeHqwAQztdJyz31Vdwg@mail.gmail.com' \
    --to=martin.agren@gmail.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).