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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: revert got_object_qid_alloc_partial change
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 7 Aug 2024 08:44:45 +0200

Download raw body.

Thread
On Tue, Aug 06, 2024 at 11:36:28PM +0200, Omar Polo wrote:
> now that the fileindex and worktree code has been fixed this workaround
> is no longer needed.  maybe for after the release to stay on the safe
> side.
> 
> passes the regress with all combinations (sha1/sha256 x pack/nopacking)
> and gotd regress too.

ok, can be shipped in release since any problem that shows
up must be a regression we don't know about yet.

> 
> diff /home/op/w/got
> commit - e016e61067cb2f0b9e60bd6127aff65dc1f977ec
> path + /home/op/w/got
> blob - c079c5e221939a0486ad03cbb7d76fad283d376f
> file + lib/object_qid.c
> --- lib/object_qid.c
> +++ lib/object_qid.c
> @@ -31,16 +31,9 @@
>  const struct got_error *
>  got_object_qid_alloc_partial(struct got_object_qid **qid)
>  {
> -	/*
> -	 * XXX(op) this should really be malloc(), but there are
> -	 * strange interactions in the fileindex and worktree code
> -	 * that are creating issues with some of the changes needed
> -	 * for sha256 support.  This will have to be revisited once
> -	 * that code is fixed.
> -	 */
> -	*qid = calloc(1, sizeof(**qid));
> +	*qid = malloc(sizeof(**qid));
>  	if (*qid == NULL)
> -		return got_error_from_errno("calloc");
> +		return got_error_from_errno("malloc");
>  
>  	(*qid)->data = NULL;
>  	return NULL;
> 
>