gitweb: do not use 'No such directory' error message
undef $project; to prevent a file named description to be read. Signed-off-by: Junio C Hamano <junkio@cox.net>
Matthias Lederhofer committed
Sep 17, 2006 at 00:30 UTC
7939fe44b8abedb4d8bb5090aec7a92eb1aa7a4b
1 file changed
+4
-7
gitweb/gitweb.perl
+4
-7
@@ -198,13 +198,10 @@ if (defined $action) {
198
199
our $project = $cgi->param('p');
200
if (defined $project) {
201
- if (!validate_input($project)) {
202
- die_error(undef, "Invalid project parameter");
203
- }
204
- if (!(-d "$projectroot/$project")) {
205
- die_error(undef, "No such directory");
206
- }
207
- if (!(-e "$projectroot/$project/HEAD")) {
201
+ if (!validate_input($project) ||
202
+ !(-d "$projectroot/$project") ||
203
+ !(-e "$projectroot/$project/HEAD")) {
204
+ undef $project;
205
die_error(undef, "No such project");
206
}
207
}