summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/goaes/commands/decrypt.go1
-rw-r--r--cmd/goaes/commands/encrypt.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/cmd/goaes/commands/decrypt.go b/cmd/goaes/commands/decrypt.go
index dc87b58..1ebf85c 100644
--- a/cmd/goaes/commands/decrypt.go
+++ b/cmd/goaes/commands/decrypt.go
@@ -51,6 +51,7 @@ func Decrypt(ctx context.Context, cmd *cli.Command) error {
return err
}
+ destination = filepath.Clean(destination)
err = os.WriteFile(destination, plaintext, fileMode)
if err != nil {
return err
diff --git a/cmd/goaes/commands/encrypt.go b/cmd/goaes/commands/encrypt.go
index db924ee..0acac46 100644
--- a/cmd/goaes/commands/encrypt.go
+++ b/cmd/goaes/commands/encrypt.go
@@ -44,6 +44,7 @@ func Encrypt(ctx context.Context, cmd *cli.Command) error {
return err
}
+ destination = filepath.Clean(destination)
err = os.WriteFile(destination, dataBuffer.Bytes(), fileMode)
if err != nil {
return err