summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-05-03 22:41:29 -0500
committerRobin Jarry <robin@jarry.cc>2022-05-04 14:10:32 +0200
commit21fca56292df154a0ec0346479f619900ffc1db9 (patch)
tree4a71f55cd92e4110859490269370b8fe27a359ac
parentdbf52bb4b48748586bb6343ae4ad6d424f0631ac (diff)
downloadaerc-21fca56292df154a0ec0346479f619900ffc1db9.zip
pgp: fix crash on gpg decrypt fail
The gpg decrypt function was catching errors but not returning them. This patch returns errors that are caught instead of aerc panicking. Reported-by: ReK2 <rek2@hispagatos.org> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: ReK2 <rek2@hispagatos.org> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--lib/crypto/gpg/gpgbin/decrypt.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/crypto/gpg/gpgbin/decrypt.go b/lib/crypto/gpg/gpgbin/decrypt.go
index 4b8d8f2..fd11b75 100644
--- a/lib/crypto/gpg/gpgbin/decrypt.go
+++ b/lib/crypto/gpg/gpgbin/decrypt.go
@@ -26,6 +26,7 @@ func Decrypt(r io.Reader) (*models.MessageDetails, error) {
md.Body = bytes.NewReader(orig)
return md, nil
default:
+ return nil, err
}
}
outRdr := bytes.NewReader(g.stdout.Bytes())