1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-28 10:28:36 +00:00

fix: gosec G304 file inclusion error (#3916)

Part of KubeCon EU 2022 Bugbash

Signed-off-by: Dhaval Shah <30974879+dhavalgshah@users.noreply.github.com>
This commit is contained in:
Dhaval Shah 2022-05-14 22:10:04 +05:30 committed by GitHub
parent 87ac548563
commit 4d0d719735
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,7 @@ func Command() *cobra.Command {
}
var input interface{}
if filename != "" {
f, err := ioutil.ReadFile(filename)
f, err := ioutil.ReadFile(filepath.Clean(filename))
if err != nil {
return fmt.Errorf("error opening input file: %w", err)
}