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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 534F01F403 for ; Sat, 22 Oct 2022 01:20:15 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=mcclimon.org header.i=@mcclimon.org header.b="HB6NLlgr"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="efu/lRsw"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbiJVBUN (ORCPT ); Fri, 21 Oct 2022 21:20:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbiJVBUL (ORCPT ); Fri, 21 Oct 2022 21:20:11 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AD669DDAC for ; Fri, 21 Oct 2022 18:20:04 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D5BFA5C00D4; Fri, 21 Oct 2022 21:20:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 21 Oct 2022 21:20:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mcclimon.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1666401603; x=1666488003; bh=PN yJWGcyU5D1GMcfCQpJ9WIiIrBIcghEeyWy0Pxcweo=; b=HB6NLlgrh2b96OfBc5 CXVAX83iysps0RV3PaBo+K3ihA03xwY5ehnlDoadTfMPEyx2bCQx0OwTKCslEe/y UnujRzm/Ya/yWZXsieHCyXCenyCbXZWPoGMxN2dcnVMaTOx3Ia7j5T9Mc8sreTM5 s+c5JyQyZKl0heK38LRvUrjcoJs8O07ssl1Y2WBvriQR9AlJqta9mDFfxVx+J6uc 0LeC2dRuJzqm9soP0QottrlBVwXoOhF7i8xIzclWT2IeifFsc3vzuJfKhfHIT7ae J1hQR81RJ9EM8PkC8UWXBtUV8xXnIWxVwhPDmr1jJl8ooMQE0Tn7sU9YzlWvJ5HS myBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1666401603; x=1666488003; bh=PNyJWGcyU5D1G McfCQpJ9WIiIrBIcghEeyWy0Pxcweo=; b=efu/lRswwvAIlMnwJ5bOtohWaI4un 8u+XTrJFxtjH0woi3Dy1RL+bj7gvuDAmyfQRxfjQqEJus3+15GSqbQEngGeVnyqQ gNnvcEZ5kD4WuXbszqAXkewWCzFTEZQFq1XNN98K3CaC9bJ7Ax7mVhAsovG5k/eO L5ZJ3n/jSJfsvsrRAXM6V9Lv422RjU/nXvIRWe/uaVqXtvQiSU9N5Ha+uDoNcl/9 LT1AvxA8vhxj0iWCgKwL3c/7+B4hvaUWobiQ91/jmk/eiZ0m17rwsofZ4gWLA6gZ CuJU/o/ix0jwVbELJDA4/0nyIDZMaffWQ5iVHK3LYQoRa81eP7yHwCakQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelledgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofhitghh rggvlhcuofgtvehlihhmohhnuceomhhitghhrggvlhesmhgttghlihhmohhnrdhorhhgqe enucggtffrrghtthgvrhhnpeeggfeuheeivefhvdeufedufeeuieehtdehveefhfduheef geevieejjeekffehvdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesmhgt tghlihhmohhnrdhorhhg X-ME-Proxy: Feedback-ID: i9dc944d1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Oct 2022 21:20:03 -0400 (EDT) From: Michael McClimon To: git@vger.kernel.org Cc: Michael McClimon , Hank Leininger Subject: [PATCH v2 1/2] Git.pm: add semicolon after catch statement Date: Fri, 21 Oct 2022 21:19:31 -0400 Message-Id: <20221022011931.43992-2-michael@mcclimon.org> X-Mailer: git-send-email 2.38.1.130.g45c9f05c In-Reply-To: <20221022011931.43992-1-michael@mcclimon.org> References: <20221016212236.12453-1-michael@mcclimon.org> <20221022011931.43992-1-michael@mcclimon.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When attempting to initialize a repository object in an unsafe directory, a syntax error is reported (Can't use string as a HASH ref while strict refs in use). Fix this runtime error by adding the required semicolon after the catch statement. Without the semicolon, the result of the following line (i.e., the result of Cwd::abs_path) is passed as the third argument to Error.pm's catch function. That function expects that its third argument, $clauses, is a hash reference, and trying to access a string as a hash reference is a fatal error. [1] https://lore.kernel.org/git/20221011182607.f1113fff-9333-427d-ba45-741a78fa6040@korelogic.com/ Reported-by: Hank Leininger Signed-off-by: Michael McClimon --- perl/Git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl/Git.pm b/perl/Git.pm index 080cdc2a..cf15ead6 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -217,7 +217,7 @@ sub repository { } catch Git::Error::Command with { # Mimic git-rev-parse --git-dir error message: throw Error::Simple("fatal: Not a git repository: $dir"); - } + }; $opts{Repository} = Cwd::abs_path($dir); } -- 2.38.1.130.g45c9f05c