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

From:
Tracey Emery <tracey@traceyemery.net>
Subject:
Re: got backout: segfault
To:
Sebastien Marie <semarie@online.fr>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 7 Feb 2020 10:37:39 -0700

Download raw body.

Thread
On Fri, Feb 07, 2020 at 06:11:27PM +0100, Sebastien Marie wrote:
> Hi,
> 
> I just found a reproductible segfault while using 'got backout'.
> 
> $ git clone --bare https://github.com/semarie/rust-ports
> $ got checkout rust-ports.git
> $ cd rust-ports
> $ got update -c 67c4a2936aa4a85b7ddc4ee009241b69e7cfda4f
> $ got backout d4a757173ee4fb1762b1dd373f1d508175846c8f
> G  Makefile
> G  distinfo
> Segmentation fault (core dumped)
> 

A NULL path is being sent to update_progress. Not sure if this should
return an error or just NULL here.

-- 

Tracey Emery

diff 992eb9d8966327c12d7e3812a2cae527f621e4ba /home/basepr1me/src/got
blob - 4329f781964bc8101d3f2bf6cb34c09f6836eee1
file + got/got.c
--- got/got.c
+++ got/got.c
@@ -1171,6 +1171,9 @@ update_progress(void *arg, unsigned char status, const
 	if (status == GOT_STATUS_BUMP_BASE)
 		return NULL;
 
+	if (path == NULL)
+		return NULL;
+
 	while (path[0] == '/')
 		path++;
 	printf("%c  %s\n", status, path);