diff mbox series

gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142

Message ID 20240111082802.ilmtwupekkbxqznw@lotus.rw.madduck.net (mailing list archive)
State New, archived
Headers show
Series gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142 | expand

Commit Message

martin f krafft Jan. 11, 2024, 8:28 a.m. UTC
Hi team,

I get tens of thousands of messages like

```
[Thu Jan 11 09:01:11 2024] gitweb.cgi: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142.
```

in my logs, presumably from crawlers hitting the CGI wrongly. This 
is using gitweb 2.39.2.

I know no Perl whatsoever, but it's my impression that the following 
patch would solve this:

```
```

This is within the wanted sub for `File::Find::find`, and it returns 
next so as to skip the currently visited file during the tree walk. 
Returning a false value, which `return` without an argument 
presumably does, should have the same effect.

Cheers,
diff mbox series

Patch

--- /tmp/gitweb.cgi	2024-01-11 09:07:47.283764508 +0100
+++ /usr/lib/cgi-bin/gitweb.cgi	2024-01-11 09:01:43.459218235 +0100
@@ -3139,7 +3139,7 @@ 
  				my $path = substr($File::Find::name, $pfxlen + 1);
  				# paranoidly only filter here
  				if ($paranoid && $filter && $path !~ m!^\Q$filter\E/!) {
-					next;
+					return;
  				}
  				# we check related file in $projectroot
  				if (check_export_ok("$projectroot/$path")) {