Commit 3440c2024b1b2537de94fb004ea946e8041da7c2

Sebastian Bauer 2015-03-17T21:38:58

Initialize refs vector in git_remote_update_tips(). Otherwise, bailing out early when ls_to_vector() fails accesses uninitialized memory.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/remote.c b/src/remote.c
index 93c6528..af5ebdf 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1459,7 +1459,7 @@ int git_remote_update_tips(
 		const char *reflog_message)
 {
 	git_refspec *spec, tagspec;
-	git_vector refs;
+	git_vector refs = GIT_VECTOR_INIT;
 	int error;
 	size_t i;