]> 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:18:24 +0000 (12:18 +0100)
commit366a16263959c0b6599f0b9ec18124d75560c6ef
tree639443fa468c3ba94e93f1d9d623cca4943779b5
parent885d97fbf84fb9de7548a5f6d4e90798f719022a
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)
crypto/x509/v3_utl.c