summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLevi Durfee <levi.durfee@gmail.com>2026-01-08 19:02:05 -0500
committerLevi Durfee <levi.durfee@gmail.com>2026-01-08 19:02:16 -0500
commit6d57a27cf963c5f75dfb327314333c1b1329b0e2 (patch)
treee9c312a53ba0a5a81491cfa95c32f4104b604ce2 /cmd
parent6f706d0d05612d9778ece6414b3427c176214586 (diff)
Clean destination filepaths
Diffstat (limited to 'cmd')
-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