diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-16 13:56:43 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-16 13:57:00 -0700 |
commit | 2846ef3e27ff0e34812dad788b706f0a1e5b5e80 (patch) | |
tree | 92b0e57a6b599bd3a4e255d6bb67b7eff2091681 /setup.c | |
parent | Merge branch 'mm/two-more-xstrfmt' into maint (diff) | |
parent | real_pathdup(): fix callsites that wanted it to die on error (diff) | |
download | tgif-2846ef3e27ff0e34812dad788b706f0a1e5b5e80.tar.xz |
Merge branch 'js/realpath-pathdup-fix' into maint
Git v2.12 was shipped with an embarrassing breakage where various
operations that verify paths given from the user stopped dying when
seeing an issue, and instead later triggering segfault.
... and then to down to 'maint'.
* js/realpath-pathdup-fix:
real_pathdup(): fix callsites that wanted it to die on error
t1501: demonstrate NULL pointer access with invalid GIT_WORK_TREE
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -698,7 +698,7 @@ static const char *setup_discovered_git_dir(const char *gitdir, /* --work-tree is set without --git-dir; use discovered one */ if (getenv(GIT_WORK_TREE_ENVIRONMENT) || git_work_tree_cfg) { if (offset != cwd->len && !is_absolute_path(gitdir)) - gitdir = real_pathdup(gitdir); + gitdir = real_pathdup(gitdir, 1); if (chdir(cwd->buf)) die_errno("Could not come back to cwd"); return setup_explicit_git_dir(gitdir, cwd, nongit_ok); @@ -806,7 +806,7 @@ static int canonicalize_ceiling_entry(struct string_list_item *item, /* Keep entry but do not canonicalize it */ return 1; } else { - char *real_path = real_pathdup(ceil); + char *real_path = real_pathdup(ceil, 0); if (!real_path) { return 0; } |