From: Pauli Date: Wed, 2 Nov 2022 01:20:16 +0000 (+1100) Subject: Coverity 1516624: Fix overrun memory access. X-Git-Tag: openssl-3.2.0-alpha1~1794 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce0a7cadadb973216399e70d3a69f352b0843deb;p=thirdparty%2Fopenssl.git Coverity 1516624: Fix overrun memory access. Not possible to hit but good to address. Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19576) --- diff --git a/test/punycode_test.c b/test/punycode_test.c index 113d04b7a98..9d8171346ca 100644 --- a/test/punycode_test.c +++ b/test/punycode_test.c @@ -154,7 +154,7 @@ static int test_punycode(int n) if (!TEST_true(ossl_punycode_decode(tc->encoded, strlen(tc->encoded), buffer, &bsize))) return 0; - for (i = 0; i < sizeof(tc->raw); i++) + for (i = 0; i < OSSL_NELEM(tc->raw); i++) if (tc->raw[i] == 0) break; if (!TEST_mem_eq(buffer, bsize * sizeof(*buffer),