Use OPENSSL_malloc_array() for ee->suites array allocation, as it is more
semantically sound and performs a size overflow check.
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Wed Feb 25 11:20:15 2026
(Merged from https://github.com/openssl/openssl/pull/30146)
}
thiskemid = (uint16_t)tmpi;
ee->nsuites = (unsigned int)(suiteoctets / OSSL_ECH_CIPHER_LEN);
- ee->suites = OPENSSL_malloc(ee->nsuites * sizeof(*ee->suites));
+ ee->suites = OPENSSL_malloc_array(ee->nsuites, sizeof(*ee->suites));
if (ee->suites == NULL)
goto err;
while (PACKET_copy_bytes(&cipher_suites, cipher,