diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2013-09-07 18:50:35 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-09-07 20:51:26 +0200 |
| commit | 69789922984d2e22f267da5f35cd64cd17c36dc0 (patch) | |
| tree | 322da1933b2832ec6709e55f8739a6dea19a53b3 /src/config_file.c | |
| parent | 73fc5e01c2ad4af7912201fc938b234a2dc854ac (diff) | |
| download | libgit2-69789922984d2e22f267da5f35cd64cd17c36dc0.tar.gz | |
config: return an error when reaching the maximum include depth
Diffstat (limited to 'src/config_file.c')
| -rw-r--r-- | src/config_file.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/config_file.c b/src/config_file.c index 48a91eb4e..034d1d7b1 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -949,9 +949,10 @@ static int config_parse(diskfile_backend *cfg_file, struct reader *reader, git_c int result = 0; khiter_t pos; - /* FIXME: should we return an error? */ - if (depth >= MAX_INCLUDE_DEPTH) - return 0; + if (depth >= MAX_INCLUDE_DEPTH) { + giterr_set(GITERR_CONFIG, "Maximum config include depth reached"); + return -1; + } /* Initialize the reading position */ reader->read_ptr = reader->buffer.ptr; |
