Check the return value of ASN1_STRING_length
authorbonniegong <yuanjungong96@gmail.com>
Wed, 2 Jun 2021 07:35:18 +0000 (15:35 +0800)
committerTomas Mraz <tomas@openssl.org>
Thu, 3 Jun 2021 15:09:02 +0000 (17:09 +0200)
commiteffb0dcf864110a4595f1a243adb9c1dd09eb516
tree435757ff1c3fcb885ede04c4ce55612fb77506d4
parentf6b6574cd73649b4bd5f695b9dbb8f80422ff244
Check the return value of ASN1_STRING_length

ASN1_STRING_length gets the field 'length' of msg, which
can be manipulated through a crafted input.
Add a check to avoid error execution of OPENSSL_malloc().

CLA: trivial

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