"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
tog: deref nlines in check
To:
Game of Trees <gameoftrees@openbsd.org>
Date:
Fri, 26 Aug 2022 01:43:37 +1000

Download raw body.

Thread
Fix typo where we incorrectly check against nlines pointer

diff /home/mark/src/got
commit - f0680473a7db1e5941bffdc2ab5f80ddec209122
path + /home/mark/src/got
blob - 530b713f15da935fc9e60332b0cbd976118130ed
file + lib/diff.c
--- lib/diff.c
+++ lib/diff.c
@@ -72,7 +72,7 @@ diff_blobs(struct got_diff_line **lines, size_t *nline
 	off_t outoff = 0;
 	int n;
 
-	if (lines && *lines && nlines > 0)
+	if (lines && *lines && *nlines > 0)
 		outoff = (*lines)[*nlines - 1].offset;
 	else if (lines) {
 		err = add_line_metadata(lines, nlines, 0, GOT_DIFF_LINE_NONE);

-- 
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68