diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-03-08 14:02:51 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-03-08 14:02:51 +0000 |
commit | 66fdb1c0d42ad45382155d93e3f53f6ee64609cb (patch) | |
tree | 301b82a3542faf8e319484ee9fa2ecb83351682f /crypto/pkcs7/pk7_smime.c | |
parent | 25bfdca16a70f38a6df9fc213a255fe6b6947fcc (diff) |
check return value of BIO_write in PKCS7_decrypt
Diffstat (limited to 'crypto/pkcs7/pk7_smime.c')
-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 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; |