aboutsummaryrefslogtreecommitdiff
path: root/builtin-init-db.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-18 14:45:59 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-18 14:45:59 -0700
commitcef5775b9f640beb51b07f8a296cfcc9b11b9744 (patch)
tree1bc646b4ffaa3d8cdd8bae0262e7eae839faa728 /builtin-init-db.c
parent1a1f063a1738f8e59c26fccdf3f60580edde3dbe (diff)
parent67daebfd3b9ba020d677e069000782b9b1e8cf75 (diff)
downloadgit-cef5775b9f640beb51b07f8a296cfcc9b11b9744.tar.gz
git-cef5775b9f640beb51b07f8a296cfcc9b11b9744.tar.xz
Merge branch 'maint'
* maint: Describe fixes since 1.6.2.3 doc/git-daemon: add missing arguments to max-connections option doc/git-daemon: add missing arguments to options init: Do not segfault on big GIT_TEMPLATE_DIR environment variable imap-send: use correct configuration variable in documentation
Diffstat (limited to 'builtin-init-db.c')
-rw-r--r--builtin-init-db.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin-init-db.c b/builtin-init-db.c
index 4e02b33bb..d1fa12a59 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -122,8 +122,10 @@ static void copy_templates(const char *template_dir)
template_dir = system_path(DEFAULT_GIT_TEMPLATE_DIR);
if (!template_dir[0])
return;
+ template_len = strlen(template_dir);
+ if (PATH_MAX <= (template_len+strlen("/config")))
+ die("insanely long template path %s", template_dir);
strcpy(template_path, template_dir);
- template_len = strlen(template_path);
if (template_path[template_len-1] != '/') {
template_path[template_len++] = '/';
template_path[template_len] = 0;