diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-12 23:21:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-12 23:21:33 -0700 |
commit | ba37c92df905a5bc51efe76e32f0e67c4ad5acbe (patch) | |
tree | a01300f6b0ae623259f04aa38cca91f6f5f81047 /setup.c | |
parent | fb070d2f17b0619cbc1be0606fd452b2294abb8d (diff) | |
parent | ce83eadd9a2c63db6263df91933da1b1b865d26a (diff) | |
download | git-ba37c92df905a5bc51efe76e32f0e67c4ad5acbe.tar.gz |
Merge branch 'js/realpath-pathdup-fix'
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.
* 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; } |