git

Форк
0
/
fuzz-commit-graph.c 
32 строки · 968.0 Байт
1
#define USE_THE_REPOSITORY_VARIABLE
2

3
#include "git-compat-util.h"
4
#include "commit-graph.h"
5
#include "repository.h"
6

7
struct commit_graph *parse_commit_graph(struct repo_settings *s,
8
					void *graph_map, size_t graph_size);
9

10
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
11

12
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
13
{
14
	struct commit_graph *g;
15

16
	initialize_repository(the_repository);
17

18
	/*
19
	 * Initialize the_repository with commit-graph settings that would
20
	 * normally be read from the repository's gitdir. We want to avoid
21
	 * touching the disk to keep the individual fuzz-test cases as fast as
22
	 * possible.
23
	 */
24
	repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
25
	the_repository->settings.commit_graph_generation_version = 2;
26
	the_repository->settings.commit_graph_changed_paths_version = 1;
27
	g = parse_commit_graph(&the_repository->settings, (void *)data, size);
28
	repo_clear(the_repository);
29
	free_commit_graph(g);
30

31
	return 0;
32
}
33

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.