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

index 0ed0feae5dbb89a95b09065ac6399256f7c97d40..a5104f8d05af7d826c5dd4c01e52ae3b9294499e 100644 (file)
@@ -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;