mirror of
https://git.proxmox.com/git/libgit2
synced 2025-10-15 23:17:35 +00:00
config: return an error when reaching the maximum include depth
This commit is contained in:
parent
73fc5e01c2
commit
6978992298
@ -949,9 +949,10 @@ static int config_parse(diskfile_backend *cfg_file, struct reader *reader, git_c
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
khiter_t pos;
|
khiter_t pos;
|
||||||
|
|
||||||
/* FIXME: should we return an error? */
|
if (depth >= MAX_INCLUDE_DEPTH) {
|
||||||
if (depth >= MAX_INCLUDE_DEPTH)
|
giterr_set(GITERR_CONFIG, "Maximum config include depth reached");
|
||||||
return 0;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize the reading position */
|
/* Initialize the reading position */
|
||||||
reader->read_ptr = reader->buffer.ptr;
|
reader->read_ptr = reader->buffer.ptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user