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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog: deref nlines in check
To:
Omar Polo <op@omarpolo.com>
Cc:
Mark Jamsek <mark@jamsek.com>, Game of Trees <gameoftrees@openbsd.org>
Date:
Tue, 30 Aug 2022 11:34:05 +0200

Download raw body.

Thread
On Thu, Aug 25, 2022 at 09:41:46PM +0200, Omar Polo wrote:
> On 2022/08/26 01:43:37 +1000, Mark Jamsek <mark@jamsek.com> wrote:
> > Fix typo where we incorrectly check against nlines pointer
> 
> yep, I think the intent was to check that *nlines is greater than
> zero, not that we have a non NULL pointer :)
> 
> ok op@

ok by me as well

> > 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);
> 
> 
>