check return value of BIO_write in PKCS7_decrypt
authorDr. Stephen Henson <steve@openssl.org>
Thu, 8 Mar 2012 14:01:44 +0000 (14:01 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 8 Mar 2012 14:01:44 +0000 (14:01 +0000)
crypto/pkcs7/pk7_smime.c

index fd56b42..6b458af 100644 (file)
@@ -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;