user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH] news_www: avoid uninitialized variables
@ 2021-09-07 14:05  7% Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2021-09-07 14:05 UTC (permalink / raw)
  To: meta

PATH_INFO may not have enough slashes for newsgroup name in the
URL at all, so ensure we don't try to further process requests
which have no chance of having a newsgroup name.
---
 lib/PublicInbox/NewsWWW.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/PublicInbox/NewsWWW.pm b/lib/PublicInbox/NewsWWW.pm
index d7dd637f..abafc4f9 100644
--- a/lib/PublicInbox/NewsWWW.pm
+++ b/lib/PublicInbox/NewsWWW.pm
@@ -45,6 +45,8 @@ sub call {
 	# some links may have the article number in them:
 	# /inbox.foo.bar/123456
 	my (undef, @parts) = split(m!/!, $env->{PATH_INFO});
+	@parts or return
+		[ 404, [qw(Content-Type text/plain)], ["404 Not Found\n"] ];
 	my ($ng, $article) = @parts;
 	my $pi_cfg = $self->{pi_cfg};
 	if (my $ibx = $pi_cfg->lookup_newsgroup($ng)) {

^ permalink raw reply related	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-09-07 14:05  7% [PATCH] news_www: avoid uninitialized variables Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).