summaryrefslogtreecommitdiff
path: root/src/cms.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cms.c')
-rw-r--r--src/cms.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cms.c b/src/cms.c
index a5fe693..c52b606 100644
--- a/src/cms.c
+++ b/src/cms.c
@@ -429,8 +429,8 @@ write_encrypted_cont (ksba_cms_t cms)
Fixme: We should write the tag here, and write a definite length
header if everything fits into our local buffer. Actually pretty
simple to do, but I am too lazy right now. */
- while (!(err = ksba_reader_read (cms->reader, buffer,
- sizeof buffer, &nread)) )
+ while (!err && !(err = ksba_reader_read (cms->reader, buffer,
+ sizeof buffer, &nread)) )
{
err = _ksba_ber_write_tl (cms->writer, TYPE_OCTET_STRING,
CLASS_UNIVERSAL, 0, nread);