summaryrefslogtreecommitdiff
path: root/src/config_file.c
diff options
context:
space:
mode:
authorYury G. Kudryashov <urkud@urkud.name>2015-02-05 23:39:59 +0300
committerYury G. Kudryashov <urkud@urkud.name>2015-02-13 00:15:16 +0300
commit1713653883c3dfd199a18b51a1e2b37def183101 (patch)
tree181066687b6d326bf5483afdbd501071171b2e4a /src/config_file.c
parent3ea78f241fb0c77822d75211752b4a1d4f299ed7 (diff)
downloadlibgit2-1713653883c3dfd199a18b51a1e2b37def183101.tar.gz
Reinit `reader` pointer after reading included config file
Fixes #2869. If included file includes more files, it may reallocate cfg_file->readers, hence invalidate not only `r` pointer, but `result` pointer as well.
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 4f041e7e3..268cced09 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -1284,6 +1284,7 @@ static int config_parse(git_strmap *values, diskfile_backend *cfg_file, struct r
if (result == 0) {
result = config_parse(values, cfg_file, r, level, depth+1);
r = git_array_get(cfg_file->readers, index);
+ reader = git_array_get(cfg_file->readers, reader_idx);
}
else if (result == GIT_ENOTFOUND) {
giterr_clear();