diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-13 09:21:33 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-13 09:21:33 +0300 |
commit | ba37c92df905a5bc51efe76e32f0e67c4ad5acbe (patch) | |
tree | a01300f6b0ae623259f04aa38cca91f6f5f81047 /builtin | |
parent | fb070d2f17b0619cbc1be0606fd452b2294abb8d (diff) | |
parent | ce83eadd9a2c63db6263df91933da1b1b865d26a (diff) |
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 'builtin')
-rw-r--r-- | builtin/init-db.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c index 1d4d6a0078..8a6acb0ec6 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -338,7 +338,7 @@ int init_db(const char *git_dir, const char *real_git_dir, { int reinit; int exist_ok = flags & INIT_DB_EXIST_OK; - char *original_git_dir = real_pathdup(git_dir); + char *original_git_dir = real_pathdup(git_dir, 1); if (real_git_dir) { struct stat st; @@ -489,7 +489,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, prefix, init_db_options, init_db_usage, 0); if (real_git_dir && !is_absolute_path(real_git_dir)) - real_git_dir = real_pathdup(real_git_dir); + real_git_dir = real_pathdup(real_git_dir, 1); if (argc == 1) { int mkdir_tried = 0; @@ -560,7 +560,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) const char *git_dir_parent = strrchr(git_dir, '/'); if (git_dir_parent) { char *rel = xstrndup(git_dir, git_dir_parent - git_dir); - git_work_tree_cfg = real_pathdup(rel); + git_work_tree_cfg = real_pathdup(rel, 1); free(rel); } if (!git_work_tree_cfg) |