From 19aa8c76ffebc88350b57bd057ceb95532dc9946 Mon Sep 17 00:00:00 2001 From: neilotoole Date: Fri, 30 Dec 2022 10:25:45 -0700 Subject: [PATCH] More error checking in cmd_version --- cli/cmd_version.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/cmd_version.go b/cli/cmd_version.go index 8f75c94e..2b039963 100644 --- a/cli/cmd_version.go +++ b/cli/cmd_version.go @@ -55,6 +55,9 @@ func execVersion(cmd *cobra.Command, args []string) error { case latestVersion = <-resultCh: if latestVersion != "" && !strings.HasPrefix(latestVersion, "v") { latestVersion = "v" + latestVersion + if !semver.IsValid(latestVersion) { + return errz.Errorf("invalid semver from brew repo: {%s}", latestVersion) + } } }