diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-05-03 22:41:29 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-05-04 14:10:32 +0200 |
commit | 21fca56292df154a0ec0346479f619900ffc1db9 (patch) | |
tree | 4a71f55cd92e4110859490269370b8fe27a359ac /lib/crypto | |
parent | dbf52bb4b48748586bb6343ae4ad6d424f0631ac (diff) | |
download | aerc-21fca56292df154a0ec0346479f619900ffc1db9.tar.gz |
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>
Diffstat (limited to 'lib/crypto')
-rw-r--r-- | lib/crypto/gpg/gpgbin/decrypt.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/crypto/gpg/gpgbin/decrypt.go b/lib/crypto/gpg/gpgbin/decrypt.go index 4b8d8f2b..fd11b755 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()) |