summaryrefslogtreecommitdiffstats
path: root/test/bio_dgram_test.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-09-23 09:41:15 +0100
committerHugo Landau <hlandau@openssl.org>2022-09-23 10:52:45 +0100
commit8e90a12ad82dec6d8b683eaa2e4feafa9796d377 (patch)
tree3aecb0a974e2e3a7c575977a734658a02e5314f7 /test/bio_dgram_test.c
parent678b489a2ae8af289cef939a538235686b448c0e (diff)
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)
Diffstat (limited to 'test/bio_dgram_test.c')
-rw-r--r--test/bio_dgram_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/bio_dgram_test.c b/test/bio_dgram_test.c
index 4dd2893c1b..f2b1bb6f4b 100644
--- a/test/bio_dgram_test.c
+++ b/test/bio_dgram_test.c
@@ -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;