From patchwork Wed Dec 4 04:46:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13893210 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E98522500D6 for ; Wed, 4 Dec 2024 04:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733287615; cv=none; b=uxIerhsM3RCbrngVhJ5h8OdknEd0BsqpS0gC07TZeaS2JYaAp240yESe2JFZFtiPd1hbLjw/CkCE7Ye245jbPNHDZhMluFLgR7rcabjFaYd667d0fIVQsNRDKuHhhFM/L6tuheIGRu6v/bnD9CBUUzDGl68E0WCul6PwOvcHbKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733287615; c=relaxed/simple; bh=NUmua8ORmsEIUAb6xAMjdsLvwl1P0MYAH53IhyQTVKo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=R+IyjKuTPHo02sCd6ial0gIGdi46tcsbd34egZrT3zebTONB45pGMwuO2qhBKDBoSyn5yKZu823fNcTc+SkncsFz/lV2W7Kuar+UvtrL8UZh7ikJqKGW4KFSfN+HJT6a+J45k2wP4nb/TNDlhQ6Iaj1s2fGMoS+i0Gda2c2I/U0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=UXzcFbQ9; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="UXzcFbQ9" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id EF717114020A; Tue, 3 Dec 2024 23:46:51 -0500 (EST) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-03.internal (MEProxy); Tue, 03 Dec 2024 23:46:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1733287611; x=1733374011; bh=WvqBrAaxEovw1SnkAjYqOqNmr3/3NpscuYy T62JsszU=; b=UXzcFbQ9N2QUb7pZRcnwuJhKWWbMZTSwsGrgtc2aXOxJZWsytrx UW9yqfZ0r17cg/7xKidU6goEAScCg57NoZJXhUYfXuNLW36+u7r5+l0pa+q1SREJ 7/L5KEyabfmUXq/oye77cyD4rt/9FulpD+YPbLIkA1HkWc7ePx0qFQ10Nkysr7rk ceQqhUDGbCp6DScs0/RLEGvCwwrlp6ExkChapFC8c4PPfapKvHId2Jp8gWuOw2XH mHD/FbIeYO2BBCeL1zGicIz5gql6MWKy8cJRxDy6zUnIIVS0g9Xu3BMDOcv00z7R 1Rl5C5Ot63HvsAWqS4Y0YLgbuOqmZsVVrYQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieeggdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefujg hffffkfgggtgesthdtredttdertdenucfhrhhomheplfhunhhiohcuvecujfgrmhgrnhho uceoghhithhsthgvrhesphhosghogidrtghomheqnecuggftrfgrthhtvghrnhepffeite eujeevfeehuddvjeduffeijeegfefhtddvkeefjeejhedtgeefgfeijedtnecuffhomhgr ihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehgihhtshhtvghrsehpohgsohigrdgtohhmpdhnsggprhgtphht thhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjohhnrghthhgrnhhtrg hnmhihsehgohhoghhlvgdrtghomhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhn vghlrdhorhhgpdhrtghpthhtohepphhssehpkhhsrdhimhdprhgtphhtthhopehgihhtsh htvghrsehpohgsohigrdgtohhm X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 3 Dec 2024 23:46:51 -0500 (EST) From: Junio C Hamano To: Jonathan Tan Cc: git@vger.kernel.org, ps@pks.im Subject: [PATCH 4/3] index-pack: work around false positive use of uninitialized variable In-Reply-To: (Jonathan Tan's message of "Tue, 3 Dec 2024 13:52:53 -0800") References: Date: Wed, 04 Dec 2024 13:46:50 +0900 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The base_name variable in this function is given a value if cmd.args array is not empty (i.e., if we run the pack-objects command), and the function returns when cmd.args is empty before hitting a call to free(base_name) near the end of the function, so to a human reader, it can be seen that the variable is not used uninitialized, but to a semi-intelligent compiler it is not so clear. Squelch a false positive by a meaningless NULL initialization. Signed-off-by: Junio C Hamano --- * Tentatively queued to unblock CI. There may be breakages due to other topics in flight, but at least this one is easy to resolve (hopefully---I haven't pushed it out). https://github.com/git/git/actions/runs/12152173257 builtin/index-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 1594f2b81d..8e600a58bf 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1803,7 +1803,7 @@ static void repack_local_links(void) struct strbuf line = STRBUF_INIT; struct oidset_iter iter; struct object_id *oid; - char *base_name; + char *base_name = NULL; if (!oidset_size(&outgoing_links)) return;