summaryrefslogtreecommitdiffstats
path: root/crypto/cms
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms_smime.c6
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)