Commit c0e038a29b28b43e5bf5e4c246a8fa5fa2bb2cd9

Etienne Samson 2018-08-21T01:12:11

revwalk: The left operand of '<' is a garbage value At line 594, we do this : if (error < 0) return error; but if nothing was pushed in a GIT_SORT_TIME revwalk, we'd return uninitialized stack data. (cherry picked from commit aa8cb5866f1eabd92c8c08f7a8610d42df07375f)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/revwalk.c b/src/revwalk.c
index eb228a5..290313a 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -522,7 +522,7 @@ cleanup:
 
 static int prepare_walk(git_revwalk *walk)
 {
-	int error;
+	int error = 0;
 	git_commit_list *list, *commits = NULL;
 	git_commit_list_node *next;