mitigate shelling out behaviour risks

This commit is contained in:
Dan Kortschak
2022-04-24 18:49:00 +09:30
committed by Jakub
parent 5c28a3eda7
commit 1ed7b690a5
6 changed files with 14 additions and 14 deletions

View File

@ -18,11 +18,11 @@
package useragent
import (
"os/exec"
"runtime"
"strings"
"github.com/Masterminds/semver/v3"
"golang.org/x/sys/execabs"
)
// IsCatalinaOrNewer checks whether the host is MacOS Catalina 10.15.x or higher.
@ -43,7 +43,7 @@ func isThisDarwinNewerOrEqual(minVersion *semver.Version) bool {
return false
}
rawVersion, err := exec.Command("sw_vers", "-productVersion").Output()
rawVersion, err := execabs.Command("sw_vers", "-productVersion").Output()
if err != nil {
return false
}