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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: gotwebd crash in got_gotweb_blame_cb
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 17 Aug 2022 15:49:57 +0200

Download raw body.

Thread
On Tue, Aug 16, 2022 at 11:42:46PM +0200, Omar Polo wrote:
> found that some hours ago gotwebd crashed.  I'm running gotwebd as of
> bf80b15220f51490025e916633cdd70816113604 ("gotwebd: fix alternate
> colors in tree entries") plus the fcgi_printf and the fix for the
> double free on gotweb_free_querystring.
> 
> can't study the stacktrace now, will do that tomorrow when I have
> time, but in the meantime I'm sharing it in case it rings some bells :)

Try the patch below.
If this is indeed the bug, then it also exists in got/got.c.

diff /home/stsp/src/got
commit - 4fcc9f7404ca2e0dd2ee085f09d6246587c6c503
path + /home/stsp/src/got
blob - 1c274b225d0e710d16528c4b9970348bb3bec74e
file + gotwebd/got_operations.c
--- gotwebd/got_operations.c
+++ gotwebd/got_operations.c
@@ -1334,7 +1334,7 @@ got_gotweb_blame_cb(void *arg, int nlines, int lineno,
 		goto done;
 	}
 
-	while (bline->annotated) {
+	while (bline->annotated && a->lineno_cur <= a->nlines) {
 		int out_buff_size = 100;
 		char *smallerthan, *at, *nl, *committer;
 		char out_buff[out_buff_size];