Skip to content

Commit

Permalink
gitweb: do not use 'No such directory' error message
Browse files Browse the repository at this point in the history
undef $project; to prevent a file named description to be read.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Matthias Lederhofer authored and Junio C Hamano committed Sep 17, 2006
1 parent 800764c commit 7939fe4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,10 @@ sub feature_pickaxe {

our $project = $cgi->param('p');
if (defined $project) {
if (!validate_input($project)) {
die_error(undef, "Invalid project parameter");
}
if (!(-d "$projectroot/$project")) {
die_error(undef, "No such directory");
}
if (!(-e "$projectroot/$project/HEAD")) {
if (!validate_input($project) ||
!(-d "$projectroot/$project") ||
!(-e "$projectroot/$project/HEAD")) {
undef $project;
die_error(undef, "No such project");
}
}
Expand Down

0 comments on commit 7939fe4

Please sign in to comment.