check return value of BIO_write in PKCS7_decrypt

This commit is contained in:
Dr. Stephen Henson 2012-03-08 14:01:44 +00:00
parent 725713f74a
commit 25d5d15fd5

View 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;