Skip to content

Commit

Permalink
cmd/utils: handle git commit a bit safer for user specified strings (e…
Browse files Browse the repository at this point in the history
…thereum#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
  • Loading branch information
epappas authored and karalabe committed Jan 3, 2018
1 parent 762f3a4 commit 7a59a93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7a59a93

Please sign in to comment.