Re: Fwd: coverity problems in reftable code
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Dec 8, 2021, 10:50 UTC
- Message-ID
- <CAFQ2z_NUCj00981oQiswaYTK6iJ=HuPjNGP46tLL-RGL2xHbEw@mail.gmail.com>
- In-Reply-To
- <YbAmANn6t9S5qKWA@coredump.intra.peff.net>
On Wed, Dec 8, 2021 at 4:26 AM Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> 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