]> git.ipfire.org Git - thirdparty/openssl.git/commit
crypto/x509/v3_utl.c: Add missing check for OPENSSL_strndup
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Mon, 21 Feb 2022 01:51:54 +0000 (09:51 +0800)
committerTomas Mraz <tomas@openssl.org>
Mon, 28 Feb 2022 11:19:11 +0000 (12:19 +0100)
commit999cce6ea7393e1daa40e9994064b2955b24a831
tree76934b0e7cf03bc0806869339c3aadc294623a49
parent0418e993c717a6863f206feaa40673a261de7395
crypto/x509/v3_utl.c: Add missing check for OPENSSL_strndup

Since the potential failure of memory allocation, it
should be better to check the return value of the
OPENSSL_strndup(), like x509v3_add_len_value().
And following the comment of 'if (astrlen < 0)',
return -1 if fails.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
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/17737)

(cherry picked from commit 366a16263959c0b6599f0b9ec18124d75560c6ef)
crypto/x509v3/v3_utl.c