Skip to content

Commit 1713653

Browse files
committed
Reinit reader pointer after reading included config file
Fixes libgit2#2869. If included file includes more files, it may reallocate cfg_file->readers, hence invalidate not only `r` pointer, but `result` pointer as well.
1 parent 3ea78f2 commit 1713653

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/config_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,7 @@ static int config_parse(git_strmap *values, diskfile_backend *cfg_file, struct r
12841284
if (result == 0) {
12851285
result = config_parse(values, cfg_file, r, level, depth+1);
12861286
r = git_array_get(cfg_file->readers, index);
1287+
reader = git_array_get(cfg_file->readers, reader_idx);
12871288
}
12881289
else if (result == GIT_ENOTFOUND) {
12891290
giterr_clear();

0 commit comments

Comments
 (0)