Commit 2839f8b93ac743994c088507979b8b79cd476a85

Stefan Sperling 2019-08-15T01:02:25

fix segfault in got's blame_cb()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/got/got.c b/got/got.c
index 6885219..de8bc60 100644
--- a/got/got.c
+++ b/got/got.c
@@ -2191,6 +2191,9 @@ blame_cb(void *arg, int nlines, int lineno, struct got_object_id *id)
 	if (sigint_received)
 		return got_error(GOT_ERR_ITER_COMPLETED);
 
+	if (lineno == -1)
+		return NULL; /* no change in this commit */
+
 	/* Annotate this line. */
 	bline = &a->lines[lineno - 1];
 	if (bline->annotated)