SSL_set1_groups_list(): Fix memory corruption with 40 groups and more
authorMichael Baentsch <57787676+baentsch@users.noreply.github.com>
Mon, 19 Feb 2024 05:41:35 +0000 (06:41 +0100)
committerMichael Baentsch <57787676+baentsch@users.noreply.github.com>
Thu, 22 Feb 2024 12:39:37 +0000 (13:39 +0100)
commit558eb2e63fe2c57196e5781e0142e5b3e8a8efef
treea5da2dce8ccb7e5bfab614582bad9f72d5a9ab58
parent76d32595e43a08df299101467d162de2391f3482
SSL_set1_groups_list(): Fix memory corruption with 40 groups and more

Fixes #23624

The calculation of the size for gid_arr reallocation was wrong.
A multiplication by gid_arr array item size was missing.

Testcase is added.

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/23659)
ssl/t1_lib.c
test/sslapitest.c
test/tls-provider.c