From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 246BD1F4B4 for ; Tue, 13 Apr 2021 08:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229753AbhDMI0R (ORCPT ); Tue, 13 Apr 2021 04:26:17 -0400 Received: from cloud.peff.net ([104.130.231.41]:50946 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbhDMI0R (ORCPT ); Tue, 13 Apr 2021 04:26:17 -0400 Received: (qmail 29328 invoked by uid 109); 13 Apr 2021 08:25:57 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 13 Apr 2021 08:25:57 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23814 invoked by uid 111); 13 Apr 2021 08:25:58 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 13 Apr 2021 04:25:58 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 13 Apr 2021 04:25:56 -0400 From: Jeff King To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Junio C Hamano , Johannes Schindelin , Taylor Blau , Elijah Newren Subject: Re: [PATCH 1/2] blob.c: remove buffer & size arguments to parse_blob_buffer() Message-ID: References: <87y2dqfgbb.fsf@evledraar.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87y2dqfgbb.fsf@evledraar.gmail.com> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sat, Apr 10, 2021 at 02:57:12PM +0200, Ævar Arnfjörð Bjarmason wrote: > > Not new in your patch, but I wondered if this could cause a segfault > > when lookup_blob() returns NULL. I _think_ the answer is "no". We'd hit > > this code path when either: > [...] > I was trying to keep the changes smaller, but what about just doing this?: > [...] Yeah, that seems pretty reasonable to me. It cleans up the extra lookups in parse_object() and gets rid of the funny-named "parse_blob_buffer()" that takes no buffer. -Peff