diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-03-08 14:01:44 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-03-08 14:01:44 +0000 |
commit | 25d5d15fd5847acf7eb46cda8d9e5aa2489dd740 (patch) | |
tree | b98fd104ed87d93f8393014c73cb6df65065fe8a | |
parent | 725713f74abce64cf122d33a3de2f7490a6b482b (diff) |
check return value of BIO_write in PKCS7_decrypt
-rw-r--r-- | crypto/pkcs7/pk7_smime.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c index fd56b42066..6b458af3d7 100644 --- a/crypto/pkcs7/pk7_smime.c +++ b/crypto/pkcs7/pk7_smime.c @@ -507,7 +507,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; |