git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb fix validating pg (page) parameter

From
MLMatthias Lederhofer <matled@gmx.net>
Date
Sep 17, 2006, 11:52 UTC
Message-ID
<20060917115245.GA15658@moooo.ath.cx>
Currently it is possible to give any string ending with a number as
page.  -1 for example is quite bad (error log shows probably 100
warnings).
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 497129a..346c15c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -259,7 +259,7 @@ if (defined $hash_parent_base) {
 
 our $page = $cgi->param('pg');
 if (defined $page) {
-	if ($page =~ m/[^0-9]$/) {
+	if ($page =~ m/[^0-9]/) {
 		die_error(undef, "Invalid page parameter");
 	}
 }
-- 
1.4.2.1.ge767
Next: Junio C Hamano
Message 1 of 4 in “gitweb fix validating pg (page) parameter”
  1. gitweb fix validating pg (page) parameterMatthias Lederhofer, Sep 17, 2006
  2. Junio C HamanoSep 17, 2006
  3. Matthias LederhoferSep 17, 2006
  4. Junio C HamanoSep 17, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.