diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-08-05 15:55:53 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-08-05 15:55:53 +0000 |
commit | 6d6c47980e943f3946b3894ac341d61e3c908c92 (patch) | |
tree | b5438f33d45800d92f2a76a892f6a0b80ae23917 /crypto/cms | |
parent | 474b3b1cc80a7c686d4a5fecc6836ec48c7c01d4 (diff) |
Correctly handle errors in CMS I/O code.
Diffstat (limited to 'crypto/cms')
-rw-r--r-- | crypto/cms/cms_smime.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 8e3221b726..dec8ef32f8 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -89,11 +89,13 @@ static int cms_copy_content(BIO *out, BIO *in, unsigned int flags) if (!BIO_get_cipher_status(in)) goto err; } + if (i < 0) + goto err; break; } - if (tmpout) - BIO_write(tmpout, buf, i); + if (tmpout && (BIO_write(tmpout, buf, i) != i)) + goto err; } if(flags & CMS_TEXT) |