If the BIO unexpectedly fails to flush then SMIME_crlf_copy() was not
correctly reporting the error. We modify it to properly propagate the
error condition.
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19920)
char eol;
int len;
char linebuf[MAX_SMLEN];
+ int ret;
/*
* Buffer output so we don't write one line at a time. This is useful
* when streaming as we don't end up with one OCTET STRING per line.
BIO_write(out, "\r\n", 2);
}
}
- (void)BIO_flush(out);
+ ret = BIO_flush(out);
BIO_pop(out);
BIO_free(bf);
+ if (ret <= 0)
+ return 0;
+
return 1;
}