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

From:
Mikhail <mp39590@gmail.com>
Subject:
Re: gotd segfault
To:
Mark Jamsek <mark@jamsek.com>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 1 May 2023 15:50:44 +0300

Download raw body.

Thread
On Mon, May 01, 2023 at 10:37:24PM +1000, Mark Jamsek wrote:
> I think we might just want to return here as client is freed in
> disconnect(), which is either called in the else case or called from
> disconnect_on_error(), and if we goto done here instead of returning we
> will perform an invalid read on client whether there is an error or not.
> Plus, the error logged in done is already logged in
> disconnect_on_error().
> 
> diff /home/mark/src/got
> commit - 79cd0a74be4fd59c3cbfc4f35772ba4336b950be
> path + /home/mark/src/got
> blob - 886f92ecc38e22a85b9de751ac0be7ba7d14d98b
> file + gotd/gotd.c
> --- gotd/gotd.c
> +++ gotd/gotd.c
> @@ -1121,7 +1121,7 @@ gotd_dispatch_auth_child(int fd, short event, void *ar
>  			disconnect_on_error(client, err);
>  		else
>  			disconnect(client);
> -		goto done;
> +		return;
>  	}
>  
>  	repo = gotd_find_repo_by_name(client->auth->repo_name, &gotd);

No crash with that patch.