Commit b97e55f2f16ea91f2e1c4e4a7e35af9b5260ca78

Edward Thomson 2014-01-18T14:48:59

Merge pull request #2059 from linquize/git_config_get_crash Fix segfault when calling git_config_get_* functions when a config fails to load

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/config.c b/src/config.c
index 8447608..fa1dd81 100644
--- a/src/config.c
+++ b/src/config.c
@@ -652,6 +652,7 @@ static int get_entry(
 		key = normalized;
 	}
 
+	res = GIT_ENOTFOUND;
 	git_vector_foreach(&cfg->files, i, internal) {
 		if (!internal || !internal->file)
 			continue;