Commit 0e530061e0eb034ab5716d97026e602c4d6e2863

Edward Thomson 2022-03-22T21:07:53

Merge pull request #6246 from bierbaum/wilhelm/fix_extension_validation_string_bug Fix a string concatenation bug when validating extensions

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/libgit2/repository.c b/src/libgit2/repository.c
index 80b4a98..f202623 100644
--- a/src/libgit2/repository.c
+++ b/src/libgit2/repository.c
@@ -1462,6 +1462,7 @@ static int check_valid_extension(const git_config_entry *entry, void *payload)
 	}
 
 	for (i = 0; i < ARRAY_SIZE(builtin_extensions); i++) {
+		git_str_clear(&cfg);
 		extension = builtin_extensions[i];
 
 		if ((error = git_str_printf(&cfg, "extensions.%s", extension)) < 0)