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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Send/Fetch plumbing in parser
To:
Tracey Emery <tracey@traceyemery.net>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 27 Aug 2021 18:09:51 +0200

Download raw body.

Thread
On Fri, Aug 27, 2021 at 09:49:22AM -0600, Tracey Emery wrote:
> Hello,
> 
> This implements the parsing code needed to add fetch and send to
> got.conf. I did not update the man page, since the fetch/send code
> hasn't been written yet.
> 
> Ok?

> +fetch		: {
> +			static const struct got_error* error;
> +
> +			error = new_fetch(&remote->fetch_repo);

What will happen if there are two or more fetch {} blocks in the file?
Will data parsed from a previous block be overwritten and its memory leaked?

Should this code check for remote->fetch_repo != NULL and raise a
syntax error if data for a fetch block has already been stored?
Or is this being handled elsewhere somehow?

Same question applies to handling of the send {} block further below.

> +			if (error) {
> +				yyerror("%s", error->msg);
> +				YYERROR;
> +			}