From: Hugo Landau Date: Fri, 23 Sep 2022 08:41:15 +0000 (+0100) Subject: Fix BIO_dgram_pair stochastic test failure X-Git-Tag: openssl-3.2.0-alpha1~2046 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e90a12ad82dec6d8b683eaa2e4feafa9796d377;p=thirdparty%2Fopenssl.git Fix BIO_dgram_pair stochastic test failure Fixes #19267. Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/19268) --- diff --git a/test/bio_dgram_test.c b/test/bio_dgram_test.c index 4dd2893c1b3..f2b1bb6f4bc 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;