diff options
author | Matt Caswell <matt@openssl.org> | 2022-12-06 14:21:23 +0000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-12-22 11:05:47 +0100 |
commit | 0a3eeb3346dd2b1f4e777284f09d40eb4c6bbd81 (patch) | |
tree | 20e83cce2318c1d3b866a1c0b6d16021a1f58c4d /test | |
parent | 1619478374f7c1a9d2da825fec87502d778c82df (diff) |
Fix SMIME_crlf_copy() to properly report an error
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/19919)
(cherry picked from commit 6259cf34eab1abdcfde12b7b3892b4780844091b)
Diffstat (limited to 'test')
-rw-r--r-- | test/bio_memleak_test.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/test/bio_memleak_test.c b/test/bio_memleak_test.c index e95c21768c..d9c744ff49 100644 --- a/test/bio_memleak_test.c +++ b/test/bio_memleak_test.c @@ -261,13 +261,9 @@ static int test_bio_i2d_ASN1_mime(void) error_callback_fired = 0; - /* - * The call succeeds even if the input stream ends unexpectedly as - * there is no handling for this case in SMIME_crlf_copy(). - */ - if (!TEST_true(i2d_ASN1_bio_stream(out, (ASN1_VALUE*) p7, bio, - SMIME_STREAM | SMIME_BINARY, - ASN1_ITEM_rptr(PKCS7)))) + if (!TEST_false(i2d_ASN1_bio_stream(out, (ASN1_VALUE*) p7, bio, + SMIME_STREAM | SMIME_BINARY, + ASN1_ITEM_rptr(PKCS7)))) goto finish; if (!TEST_int_eq(error_callback_fired, 1)) |