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)
committerTomas Mraz <tomas@openssl.org>
Thu, 22 Feb 2024 11:48:21 +0000 (12:48 +0100)
commitf4ed6eed2c8fcb1852938683669218655fe4f894
tree36d38c2936c37723d3c5b9a5bcadb49564661d47
parentdb511578f7822ed6aa47760adfdc08ef84a17698
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>
(Merged from https://github.com/openssl/openssl/pull/23625)
ssl/t1_lib.c
test/sslapitest.c
test/tls-provider.c