summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cms/cms_smime.c
diff options
context:
space:
mode:
authordjm <>2009-01-09 12:14:11 +0000
committerdjm <>2009-01-09 12:14:11 +0000
commita0fdc9ec41594852f67ec77dfad9cb06bacc4186 (patch)
treec43f6b3a4d93ad2cb3dcf93275295679d895a033 /src/lib/libcrypto/cms/cms_smime.c
parent5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80 (diff)
downloadopenbsd-a0fdc9ec41594852f67ec77dfad9cb06bacc4186.tar.gz
openbsd-a0fdc9ec41594852f67ec77dfad9cb06bacc4186.tar.bz2
openbsd-a0fdc9ec41594852f67ec77dfad9cb06bacc4186.zip
import openssl-0.9.8j
Diffstat (limited to 'src/lib/libcrypto/cms/cms_smime.c')
-rw-r--r--src/lib/libcrypto/cms/cms_smime.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/libcrypto/cms/cms_smime.c b/src/lib/libcrypto/cms/cms_smime.c
index f79c504e91..b9463f9abb 100644
--- a/src/lib/libcrypto/cms/cms_smime.c
+++ b/src/lib/libcrypto/cms/cms_smime.c
@@ -68,7 +68,10 @@ static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
68 if (out == NULL) 68 if (out == NULL)
69 tmpout = BIO_new(BIO_s_null()); 69 tmpout = BIO_new(BIO_s_null());
70 else if (flags & CMS_TEXT) 70 else if (flags & CMS_TEXT)
71 {
71 tmpout = BIO_new(BIO_s_mem()); 72 tmpout = BIO_new(BIO_s_mem());
73 BIO_set_mem_eof_return(tmpout, 0);
74 }
72 else 75 else
73 tmpout = out; 76 tmpout = out;
74 77
@@ -89,11 +92,13 @@ static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
89 if (!BIO_get_cipher_status(in)) 92 if (!BIO_get_cipher_status(in))
90 goto err; 93 goto err;
91 } 94 }
95 if (i < 0)
96 goto err;
92 break; 97 break;
93 } 98 }
94 99
95 if (tmpout) 100 if (tmpout && (BIO_write(tmpout, buf, i) != i))
96 BIO_write(tmpout, buf, i); 101 goto err;
97 } 102 }
98 103
99 if(flags & CMS_TEXT) 104 if(flags & CMS_TEXT)