From 21fca56292df154a0ec0346479f619900ffc1db9 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 3 May 2022 22:41:29 -0500 Subject: 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 Signed-off-by: Tim Culverhouse Tested-by: ReK2 Acked-by: Robin Jarry --- lib/crypto/gpg/gpgbin/decrypt.go | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/crypto') 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()) -- cgit