crypto/asn1/a_time.c: Add check for OPENSSL_malloc
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Wed, 15 Jun 2022 08:07:12 +0000 (16:07 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 17 Jun 2022 06:51:11 +0000 (08:51 +0200)
commit8547cd6790881cbba0f20aa4ce048243065a24bf
treed04500b9eb9d2948d4865d9ffb8a69f3acdc102a
parent93ed4b5fb40a8ece9d9c67041c4187d63dbfbd51
crypto/asn1/a_time.c: Add check for OPENSSL_malloc

As the potential failure of the OPENSSL_malloc(),
timestamp_tm could be NULL and be used in ASN1_TIME_to_tm()
without check.
Therefore, it should be better to check the return value of
OPENSSL_malloc() and return error if fails.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18575)
crypto/asn1/a_time.c