From 6d57a27cf963c5f75dfb327314333c1b1329b0e2 Mon Sep 17 00:00:00 2001 From: Levi Durfee Date: Thu, 8 Jan 2026 19:02:05 -0500 Subject: Clean destination filepaths --- cmd/goaes/commands/decrypt.go | 1 + cmd/goaes/commands/encrypt.go | 1 + 2 files changed, 2 insertions(+) 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 -- cgit v1.2.3