X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-init-db.c;h=d1fa12a59efb34256b2cc80b03c637cc844d84ff;hb=95a877a34c3838a92a99794ebc3b082f6f525899;hp=4e02b33bb77b8957940562f87bc0b6faaeb3a101;hpb=6da14ee14f85fe5766780e1cbe8d42d385638e9e;p=git.git 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;