Fix BIO_dgram_pair stochastic test failure

Fixes #19267.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19268)
This commit is contained in:
Hugo Landau 2022-09-23 09:41:15 +01:00
parent 678b489a2a
commit 8e90a12ad8

View File

@ -530,7 +530,7 @@ static int test_bio_dgram_pair(void)
if (!TEST_int_eq(random_data(key, scratch, sizeof(scratch), i), 1))
goto err;
blen = (*(uint32_t*)scratch) % mtu1;
blen = ((*(uint32_t*)scratch) % mtu1) + 1;
r = BIO_write(bio1, scratch + 4, blen);
if (r == -1)
break;
@ -556,7 +556,7 @@ static int test_bio_dgram_pair(void)
if (!TEST_int_eq(random_data(key, scratch, sizeof(scratch), i), 1))
goto err;
blen = (*(uint32_t*)scratch) % mtu1;
blen = ((*(uint32_t*)scratch) % mtu1) + 1;
r = BIO_read(bio2, scratch2, sizeof(scratch2));
if (!TEST_int_eq(r, blen))
goto err;