Fix undefined behaviour in EC_GROUP_new_from_ecparameters
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 21 May 2022 06:03:14 +0000 (08:03 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 24 May 2022 09:42:57 +0000 (11:42 +0200)
commit97de6145851922a33f7afd9c308adfc1b2e5732b
tree39f69c63eff4e978af5748bcbf6e71cf347679eb
parent22a96c6be41897d11a18455b2ab142422bc57f3f
Fix undefined behaviour in EC_GROUP_new_from_ecparameters

This happens for instance with
fuzz/corpora/asn1/65cf44e85614c62f10cf3b7a7184c26293a19e4a
and causes the OPENSSL_malloc below to choke on the
zero length allocation request.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18365)
crypto/ec/ec_asn1.c