Re: SHA1 collision in production repo?! (probably not)
- From
Jeff King <peff@peff.net>
- Date
- Mar 31, 2017, 17:48 UTC
- Message-ID
- <20170331174827.zheqstwtlsqtxa6e@sigill.intra.peff.net>
- In-Reply-To
- <20170331174515.j2ruifuigskyvucc@sigill.intra.peff.net>
On Fri, Mar 31, 2017 at 01:45:15PM -0400, Jeff King wrote:
Show 17 quoted lines
> I suspect this may improve things, but I haven't dug deeper to see if > there are unwanted side effects, or if there are other spots that need > similar treatment. > > diff --git a/sha1_file.c b/sha1_file.c > index 43990dec7..38411f90b 100644 > --- a/sha1_file.c > +++ b/sha1_file.c > @@ -2952,7 +2952,7 @@ static int sha1_loose_object_info(const unsigned char *sha1, > if (status && oi->typep) > *oi->typep = status; > strbuf_release(&hdrbuf); > - return 0; > + return status; > } > > int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi, unsigned flags)
Er, no, that's totally wrong. "status' may be holding the type. It should really be:
return status < 0 ? status : 0;
-Peff