Commit aa8cb5866f1eabd92c8c08f7a8610d42df07375f

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/revwalk.c b/src/revwalk.c
index be647af..da84a44 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -550,7 +550,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;