git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@google.com>
To: Jeff King <peff@peff.net>
Cc: git <git@vger.kernel.org>
Subject: Re: Fwd: coverity problems in reftable code
Date: Wed, 8 Dec 2021 11:50:16 +0100	[thread overview]
Message-ID: <CAFQ2z_NUCj00981oQiswaYTK6iJ=HuPjNGP46tLL-RGL2xHbEw@mail.gmail.com> (raw)
In-Reply-To: <YbAmANn6t9S5qKWA@coredump.intra.peff.net>

On Wed, Dec 8, 2021 at 4:26 AM Jeff King <peff@peff.net> wrote:
> I also applied your coverity fixups to my tree, and pushed up the
> result. As expected, Coverity claims many problems fixed, but also a few
> new ones found.
>
> Summary is below, but I'm not sure it's that useful without the whole
> code flow. The unreachable-code one seems just wrong. We can get there
> via the "goto done" in the BLOCK_TYPE_LOG conditional, it looks like.
>

they're all valid. There is a shadowed variable in the unreachable code one.


> The first FORWARD_NULL doesn't look obvious to me from the code. But it
> triggers a segfault running "test-tool reftable". (It didn't immediately
> for me on Linux, but Windows CI shows it, and compiling with ASan on
> Linux does too).

yeah, that must be the problem on windows too. The 3rd test case
passes NULL into memcmp() with a 0 length.

I've folded in your patch and fixed the issues.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--
Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

  reply	other threads:[~2021-12-08 10:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-04  2:13 coverity problems in reftable code Jeff King
     [not found] ` <CAFQ2z_OK5949p1WfovJ00Katk5hTv_oeLo-ZRCi1XqrtzQqL2g@mail.gmail.com>
2021-12-07 11:34   ` Fwd: " Han-Wen Nienhuys
2021-12-07 17:46     ` Ævar Arnfjörð Bjarmason
2021-12-08  1:46     ` Jeff King
2021-12-08  3:26       ` Jeff King
2021-12-08 10:50         ` Han-Wen Nienhuys [this message]
2021-12-08 19:12           ` 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='CAFQ2z_NUCj00981oQiswaYTK6iJ=HuPjNGP46tLL-RGL2xHbEw@mail.gmail.com' \
    --to=hanwen@google.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.
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 NNTP newsgroup(s).