Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'cc/split-index-config'
author
Junio C Hamano
<gitster@pobox.com>
Wed, 26 Apr 2017 06:39:09 +0000
(15:39 +0900)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 26 Apr 2017 06:39:09 +0000
(15:39 +0900)
The split-index code configuration code used an unsafe git_path()
function without copying its result out.
* cc/split-index-config:
read-cache: avoid using git_path() in freshen_shared_index()
read-cache.c
patch
|
blob
|
history
raw
(from parent 1:
b80f629
)
diff --git
a/read-cache.c
b/read-cache.c
index d8c657d6a7faa717be8459cf88de83acc51ddde1..b3d0f3c30bfd7ee054d406afd8d8df29342105c2 100644
(file)
--- a/
read-cache.c
+++ b/
read-cache.c
@@
-1824,9
+1824,10
@@
int do_read_index(struct index_state *istate, const char *path, int must_exist)
*/
static void freshen_shared_index(char *base_sha1_hex, int warn)
{
- c
onst char *shared_index = git_path
("sharedindex.%s", base_sha1_hex);
+ c
har *shared_index = git_pathdup
("sharedindex.%s", base_sha1_hex);
if (!check_and_freshen_file(shared_index, 1) && warn)
warning("could not freshen shared index '%s'", shared_index);
+ free(shared_index);
}
int read_index_from(struct index_state *istate, const char *path)