From: Dr. Stephen Henson Date: Thu, 8 Mar 2012 14:02:00 +0000 (+0000) Subject: check return value of BIO_write in PKCS7_decrypt X-Git-Tag: OpenSSL_1_0_0h~7 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=18ea747ce433da15529e6c90956b88740bd335c3 check return value of BIO_write in PKCS7_decrypt --- diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c index 0ed0feae5d..a5104f8d05 100644 --- a/crypto/pkcs7/pk7_smime.c +++ b/crypto/pkcs7/pk7_smime.c @@ -594,7 +594,11 @@ int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags) break; } - BIO_write(data, buf, i); + if (BIO_write(data, buf, i) != i) + { + ret = 0; + break; + } } BIO_free_all(tmpmem); return ret;