summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2022-11-02 12:20:16 +1100
committerTomas Mraz <tomas@openssl.org>2022-11-03 10:32:33 +0100
commitde45fecf8aeab68cd137c7737973e00a9669897c (patch)
tree06cf808ba266d98e0ed1f39539e14bc72269aab6 /test
parentf8e6dda7b7c2d9456ca3b175ac6aa0d0b9bc84b0 (diff)
Coverity 1516624: Fix overrun memory access.
Not possible to hit but good to address. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19576) (cherry picked from commit ce0a7cadadb973216399e70d3a69f352b0843deb)
Diffstat (limited to 'test')
-rw-r--r--test/punycode_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/punycode_test.c b/test/punycode_test.c
index 113d04b7a9..9d8171346c 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),