Skip to content

Commit

Permalink
Merge pull request #1362 from kolyshkin/v1-bad-open
Browse files Browse the repository at this point in the history
Don't call open("") backport
  • Loading branch information
meatballhat authored Apr 22, 2022
2 parents b963ddc + 0fbd4f5 commit 1b4a05e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ func flagFromFileEnv(filePath, envName string) (val string, ok bool) {
}
}
for _, fileVar := range strings.Split(filePath, ",") {
if data, err := ioutil.ReadFile(fileVar); err == nil {
return string(data), true
if fileVar != "" {
if data, err := ioutil.ReadFile(fileVar); err == nil {
return string(data), true
}
}
}
return "", false
Expand Down

0 comments on commit 1b4a05e

Please sign in to comment.