while fuzzing, limit # objects read

This commit is contained in:
Nelson Elhage
2018-06-24 06:51:08 +00:00
parent 6dfc8bc249
commit 912c59c948

View File

@@ -563,6 +563,11 @@ int git_indexer_append(git_indexer *idx, const void *data, size_t size, git_tran
total_objects = (unsigned int)idx->nr_objects;
else
total_objects = UINT_MAX;
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
if (total_objects > 4096) {
total_objects = 4096;
}
#endif
idx->pack->idx_cache = git_oidmap_alloc();
GITERR_CHECK_ALLOC(idx->pack->idx_cache);