diff options
| author | Levi Durfee <levi.durfee@gmail.com> | 2026-01-07 14:11:55 -0500 |
|---|---|---|
| committer | Levi Durfee <levi.durfee@gmail.com> | 2026-01-07 14:11:55 -0500 |
| commit | 63548a63e1b240dd8c254b1153d9b78e84082cc9 (patch) | |
| tree | 8fbb69ff76fc58bd47c07769c5bab34854e4d432 /cmd | |
| parent | fb6725c11a01ac6da64ff9c448e9ee405e16b485 (diff) | |
Clean filepaths
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/goaes/commands/decrypt.go | 2 | ||||
| -rw-r--r-- | cmd/goaes/commands/encrypt.go | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/cmd/goaes/commands/decrypt.go b/cmd/goaes/commands/decrypt.go index 1912c1a..a590f47 100644 --- a/cmd/goaes/commands/decrypt.go +++ b/cmd/goaes/commands/decrypt.go @@ -5,6 +5,7 @@ import ( "encoding/gob" "log/slog" "os" + "path/filepath" "github.com/nerdsec/goaes/internal" "github.com/urfave/cli/v3" @@ -14,6 +15,7 @@ func Decrypt(ctx context.Context, cmd *cli.Command) error { source := cmd.String("source") destination := cmd.String("destination") + source = filepath.Clean(source) file, err := os.Open(source) if err != nil { return err diff --git a/cmd/goaes/commands/encrypt.go b/cmd/goaes/commands/encrypt.go index c658780..b50ef97 100644 --- a/cmd/goaes/commands/encrypt.go +++ b/cmd/goaes/commands/encrypt.go @@ -5,6 +5,7 @@ import ( "context" "encoding/gob" "os" + "path/filepath" "github.com/nerdsec/goaes/internal" "github.com/urfave/cli/v3" @@ -14,6 +15,7 @@ func Encrypt(ctx context.Context, cmd *cli.Command) error { source := cmd.String("source") destination := cmd.String("destination") + source = filepath.Clean(source) plaintext, err := os.ReadFile(source) if err != nil { return err |
