From patchwork Fri Apr 24 13:34:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Rapha=C3=ABl_Gertz?= X-Patchwork-Id: 11508041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E66B14B4 for ; Fri, 24 Apr 2020 14:52:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FAA320767 for ; Fri, 24 Apr 2020 14:52:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727088AbgDXOw6 (ORCPT ); Fri, 24 Apr 2020 10:52:58 -0400 Received: from 4.mo3.mail-out.ovh.net ([178.33.46.10]:38775 "EHLO 4.mo3.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726959AbgDXOw6 (ORCPT ); Fri, 24 Apr 2020 10:52:58 -0400 X-Greylist: delayed 2402 seconds by postgrey-1.27 at vger.kernel.org; Fri, 24 Apr 2020 10:52:57 EDT Received: from player735.ha.ovh.net (unknown [10.110.171.49]) by mo3.mail-out.ovh.net (Postfix) with ESMTP id 7DA0724DA2F for ; Fri, 24 Apr 2020 15:34:43 +0200 (CEST) Received: from RCM-web10.webmail.mail.ovh.net (ip-209.net-89-3-147.rev.numericable.fr [89.3.147.209]) (Authenticated sender: postmaster@rapsys.eu) by player735.ha.ovh.net (Postfix) with ESMTPSA id 6430F11832200 for ; Fri, 24 Apr 2020 13:34:43 +0000 (UTC) MIME-Version: 1.0 Date: Fri, 24 Apr 2020 15:34:43 +0200 From: =?utf-8?q?Rapha=C3=ABl_Gertz?= To: git@vger.kernel.org Subject: PullRequest: gitweb.perl: fix 'Use of uninitialized value $params{"action"} in string eq at gitweb.cgi line 1377' User-Agent: Roundcube Webmail/1.4.2 Message-ID: <903700aa01abb139e9bf422835b26ca2@rapsys.eu> X-Sender: git@rapsys.eu X-Originating-IP: 89.3.147.209 X-Webmail-UserID: postmaster@rapsys.eu X-Ovh-Tracer-Id: 16929875428148612829 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedrhedugdeiudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhepgggtgfffhffvufgfkfigihesmhejjhertdervdenucfhrhhomheptfgrphhhrgotlhgpifgvrhhtiicuoehgihhtsehrrghpshihshdrvghuqeenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppedtrddtrddtrddtpdekledrfedrudegjedrvddtleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejfeehrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepghhithesrhgrphhshihsrdgvuhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi, This is a small fix in gitweb/gitweb.perl script that I tried to get applied long ago. The current gitweb.perl cgi script generate lots of warnings in the web server logs without reason by skipping defined test. Pull request was done here against "maint" branch : https://github.com/gitgitgadget/git/pull/617 Pull request was done here against "master" branch if required : https://github.com/git/git/pull/767 The change patch is attached if required. May you plz merge my change ? Best regards diff -urNp gitweb/gitweb.perl.orig gitweb/gitweb.perl --- gitweb/gitweb.perl.orig 2019-11-14 07:39:24.244704744 +0100 +++ gitweb/gitweb.perl 2019-11-14 07:33:50.641602829 +0100 @@ -1374,7 +1374,7 @@ sub href { # since we destructively absorb parameters, we keep this # boolean that remembers if we're handling a snapshot - my $is_snapshot = $params{'action'} eq 'snapshot'; + my $is_snapshot = defined $params{'action'} && $params{'action'} eq 'snapshot'; # Summary just uses the project path URL, any other action is # added to the URL @@ -5959,7 +5959,7 @@ sub git_history_body { $cgi->a({-href => href(action=>$ftype, hash_base=>$commit, file_name=>$file_name)}, $ftype) . " | " . $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff"); - if ($ftype eq 'blob') { + if (defined $ftype && $ftype eq 'blob') { print " | " . $cgi->a({-href => href(action=>"blob_plain", hash_base=>$commit, file_name=>$file_name)}, "raw"); diff -urNp gitweb/README.orig gitweb/README --- gitweb/README.orig 2019-11-14 07:39:24.244704744 +0100 +++ gitweb/README 2019-11-14 07:33:50.641602829 +0100 @@ -66,5 +66,8 @@ AUTHORS Originally written by: Kay Sievers +Perl warning fix: + Raphaƫl Gertz + Any comment/question/concern to: Git mailing list