From 784b14806812d40f8258b78b20a5d54a0507ffb1 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sat, 21 Apr 2018 11:40:19 -0600 Subject: * The list of public certificates is freed before it is reused when a signature fails to verify. This causes Alpine to crash. Patch submitted by Linus Torvalds. --- pith/smime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pith') diff --git a/pith/smime.c b/pith/smime.c index 9cab8ee2..e899c9c8 100644 --- a/pith/smime.c +++ b/pith/smime.c @@ -2832,8 +2832,6 @@ do_signature_verify(PKCS7 *p7, BIO *in, BIO *out, int silent) result = PKCS7_verify(p7, otherCerts, s_cert_store, in, out, flags); - sk_X509_pop_free(otherCerts, X509_free); - if(result){ q_status_message(SM_ORDER, 1, 1, _("S/MIME signature verified ok")); } @@ -2851,6 +2849,8 @@ do_signature_verify(PKCS7 *p7, BIO *in, BIO *out, int silent) _("Couldn't verify S/MIME signature: %s"), (char*) openssl_error_string()); } + sk_X509_pop_free(otherCerts, X509_free); + return result; } -- cgit v1.2.3-54-g00ecf