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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: gotwebd: guard against missing qs->file
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 29 Jan 2024 14:20:43 +0100

Download raw body.

Thread
On Mon, Jan 29, 2024 at 01:52:30PM +0100, Omar Polo wrote:
> @@ -218,6 +223,10 @@ gotweb_process_request(struct request *c)
>  
>  	switch (qs->action) {
>  	case BLAME:
> +		if (qs->folder == NULL || qs->file == NULL) {

This change introduces a small inconsistency:
qs->folder is allowed to be NULL in got_output_file_blame() which now
becomes impossible to reach.

> +			error = got_error(GOT_ERR_BAD_QUERYSTRING);
> +			goto err;
> +		}
>  		error = got_get_repo_commits(c, 1);
>  		if (error) {
>  			log_warnx("%s: %s", __func__, error->msg);
> 
>