aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorEvangelos Pappas <epappas@evalonlabs.com>2018-01-04 00:18:53 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-04 00:18:53 +0800
commit7a59a9380e9f12729bb094de4151c3d135bdadf9 (patch)
treeb29f44ad5c909d3afbd02b6e2018cdf2f27196c9 /cmd/utils
parent762f3a48a00da02fe58063cb6ce8dc2d08821f15 (diff)
downloadgo-tangerine-7a59a9380e9f12729bb094de4151c3d135bdadf9.tar.gz
go-tangerine-7a59a9380e9f12729bb094de4151c3d135bdadf9.tar.zst
go-tangerine-7a59a9380e9f12729bb094de4151c3d135bdadf9.zip
cmd/utils: handle git commit a bit safer for user specified strings (#15790)
* cmd/utils/flags.go: Applying a String len guard for the gitCommit param of the NewApp() * cmd/utils: remove redundant clause in if condition
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 734cf6f36..edf3dc2c2 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -96,7 +96,7 @@ func NewApp(gitCommit, usage string) *cli.App {
//app.Authors = nil
app.Email = ""
app.Version = params.Version
- if gitCommit != "" {
+ if len(gitCommit) >= 8 {
app.Version += "-" + gitCommit[:8]
}
app.Usage = usage