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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: fix got clone url with trailing slash
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 7 Mar 2022 20:27:20 +0100

Download raw body.

Thread
On Mon, Mar 07, 2022 at 05:13:47PM +0100, Christian Weisgerber wrote:
> Stefan Sperling:
> 
> > This patch makes the URI parser tolerate trailing slashes at the end
> > of the input URI and adds a few additional sanity checks for empty
> > URI components found during parsing.
> 
> ok naddy

Thanks!

> I noticed that we also need to fix the level of indirection in two
> places:

Yes, indeed. OK by me.

> diff 456f032ded164edd13735eb90268950619f02c22 7cc7e79e6b416c1510fb88f83a659c2b46147a6e
> blob - 2e29508e51eb4534e7588561c727f6b6cf352503
> blob + 096f0320a2c1debb9a1de9ac9c0a8e2bbab704cd
> --- lib/dial.c
> +++ lib/dial.c
> @@ -90,7 +90,7 @@ got_dial_parse_uri(char **proto, char **host, char **p
>  	if (!p) {
>  		/* Try parsing Git's "scp" style URL syntax. */
>  		*proto = strdup("ssh");
> -		if (proto == NULL) {
> +		if (*proto == NULL) {
>  			err = got_error_from_errno("strdup");
>  			goto done;
>  		}
> @@ -118,7 +118,7 @@ got_dial_parse_uri(char **proto, char **host, char **p
>  		p = q + 1;
>  	} else {
>  		*proto = strndup(uri, p - uri);
> -		if (proto == NULL) {
> +		if (*proto == NULL) {
>  			err = got_error_from_errno("strndup");
>  			goto done;
>  		}
> 
> -- 
> Christian "naddy" Weisgerber                          naddy@mips.inka.de
> 
>