Open simondeziel opened 2 days ago
lxc will panic if the expected token is an empty string:
lxc
$ lxc remote add target '' panic: runtime error: index out of range [0] with length 0 goroutine 1 [running]: main.(*cmdRemoteAdd).run(0xc000201ce0, 0xc0001b19c8?, {0xc00020d4c0, 0x2, 0x0?}) github.com/canonical/lxd/lxc/remote.go:352 +0x2cb9 github.com/spf13/cobra.(*Command).execute(0xc0002dc308, {0xc00020d4a0, 0x2, 0x2}) github.com/spf13/cobra@v1.8.1/command.go:985 +0xaca github.com/spf13/cobra.(*Command).ExecuteC(0xc0001faf08) github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/cobra@v1.8.1/command.go:1041 main.main() github.com/canonical/lxd/lxc/main.go:289 +0x1c13
While it is obviously being feed bogus data (`` isn't a valid token), panicking isn't a nice failure mode.
lxc
will panic if the expected token is an empty string:While it is obviously being feed bogus data (`` isn't a valid token), panicking isn't a nice failure mode.