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)
This commit is contained in:
Pauli 2022-11-02 12:20:16 +11:00 committed by Tomas Mraz
parent 00e38edcfb
commit ce0a7cadad

View File

@ -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),