From 6c7855038fdbbc204ab96a4a0fdbc7ed735216df Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 8 Apr 2023 20:08:36 +0000 Subject: [PATCH] viewvcs: avoid uninitialized var on unusable filenames This happens if somebody uses a bogus filename like `.' for the `b=' parameter (e.g. GET `$REPO/$OID/?b=.'). --- lib/PublicInbox/ViewVCS.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index de8600ee1..eb757089c 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -514,7 +514,7 @@ sub solve_result { return show_other($ctx, $res) if $type ne 'blob'; my $fn = $di->{path_b} // $hints->{path_b}; my $paths = $ctx->{-paths} //= do { - my $path = to_filename($fn // 'blob'); + my $path = to_filename($fn // 'blob') // 'blob'; my $raw_more = qq[(raw)]; my @def; -- 2.47.2