Skip to content

Commit

Permalink
Fix BIO_dgram_pair stochastic test failure
Browse files Browse the repository at this point in the history
Fixes #19267.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #19268)
  • Loading branch information
hlandau committed Sep 23, 2022
1 parent 678b489 commit 8e90a12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/bio_dgram_test.c
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 8e90a12

Please sign in to comment.