From c2ac282aca01adf68c6ddf0870d1478c5e48049d Mon Sep 17 00:00:00 2001 From: Nick Vollmar Date: Mon, 12 Nov 2018 11:45:47 -0600 Subject: [PATCH] TUN-1190: check URL parse error when starting SSH proxy server --- cmd/cloudflared/tunnel/cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cloudflared/tunnel/cmd.go b/cmd/cloudflared/tunnel/cmd.go index 2b8a3092..b6eb3aef 100644 --- a/cmd/cloudflared/tunnel/cmd.go +++ b/cmd/cloudflared/tunnel/cmd.go @@ -311,7 +311,7 @@ func StartServer(c *cli.Context, version string, shutdownC, graceShutdownC chan c.Set("url", "https://"+helloListener.Addr().String()) } - if uri, _ := url.Parse(c.String("url")); uri.Scheme == "ssh" { + if uri, err := url.Parse(c.String("url")); err == nil && uri.Scheme == "ssh" { host := uri.Host if uri.Port() == "" { // default to 22 host = uri.Hostname() + ":22"