Commit ad95873bad6ca38e3d7069172627bf104788d0b0

Etienne Samson 2018-08-21T01:41:05

mailmap: Undefined or garbage value returned to caller In case there was nothing to parse in the buf, we'd return uninitialized stack data.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/mailmap.c b/src/mailmap.c
index fe4d452..1f725b3 100644
--- a/src/mailmap.c
+++ b/src/mailmap.c
@@ -225,7 +225,7 @@ int git_mailmap_add_entry(
 
 static int mailmap_add_buffer(git_mailmap *mm, const char *buf, size_t len)
 {
-	int error;
+	int error = 0;
 	git_parse_ctx ctx;
 
 	/* Scratch buffers containing the real parsed names & emails */