unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] viewvcs: avoid uninitialized var on unusable filenames
@ 2023-04-08 20:08 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-04-08 20:08 UTC (permalink / raw)
  To: meta

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 964b7345..3ab39c8b 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[(<a\nhref="$path">raw</a>)];
 		my @def;
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-08 20:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-08 20:08 [PATCH] viewvcs: avoid uninitialized var on unusable filenames Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).