t5505: add missing &&
[gitweb.git] / setup.c
diff --git a/setup.c b/setup.c
index 2cf0f1993718fd737cd87e79d2f4950832c59c9f..2fa7969e8222be068a07a7888b5c91c3a6bd09e5 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -158,6 +158,8 @@ static int is_git_directory(const char *suspect)
        char path[PATH_MAX];
        size_t len = strlen(suspect);
 
+       if (PATH_MAX <= len + strlen("/objects"))
+               die("Too long path: %.*s", 60, suspect);
        strcpy(path, suspect);
        if (getenv(DB_ENVIRONMENT)) {
                if (access(getenv(DB_ENVIRONMENT), X_OK))