Skip to content

Commit 7a59a93

Browse files
epappaskaralabe
authored andcommitted
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
1 parent 762f3a4 commit 7a59a93

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎cmd/utils/flags.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func NewApp(gitCommit, usage string) *cli.App {
9696
//app.Authors = nil
9797
app.Email = ""
9898
app.Version = params.Version
99-
if gitCommit != "" {
99+
if len(gitCommit) >= 8 {
100100
app.Version += "-" + gitCommit[:8]
101101
}
102102
app.Usage = usage

0 commit comments

Comments
 (0)