Commit Diff


commit - 73675c3a673715141c3872d1f25eafaffb1ac0a5
commit + 9ac925e0c64b99fc2a90aedd609165e34399f4ac
blob - 8cb8b818f4c6074b02022a654a94701232e3456b
blob + 6b604d8770a647fa45b6f3996abc29622426583b
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.c
@@ -195,6 +195,11 @@ gotweb_process_request(struct request *c)
 	}
 
 	if (qs->action != INDEX) {
+		if (qs->path == NULL) {
+			error = got_error(GOT_ERR_BAD_QUERYSTRING);
+			goto err;
+		}
+
 		error = gotweb_load_got_path(&repo_dir, qs->path, c);
 		c->t->repo_dir = repo_dir;
 		if (error)
@@ -1069,9 +1074,6 @@ gotweb_load_got_path(struct repo_dir **rp, const char 
 	DIR *dt;
 	char *dir_test;
 
-	if (dir == NULL)
-		return got_error(GOT_ERR_NOT_GIT_REPO);
-
 	*rp = calloc(1, sizeof(**rp));
 	if (*rp == NULL)
 		return got_error_from_errno("calloc");