diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2019-08-16 15:32:32 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2019-08-16 15:32:32 +0200 |
commit | 7fafaf27c2c2990fde2798424a38ce8443dae595 (patch) | |
tree | 6ea68fbf3022939926d772de3ad3f7b59388d906 /crypto | |
parent | d333ebaf9c77332754a9d5e111e2f53e1de54fdd (diff) |
Fix error handling in X509_chain_up_ref
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9615)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/x509/x509_cmp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/x509/x509_cmp.c b/crypto/x509/x509_cmp.c index 2d82f8fa8b..a7b90e6a42 100644 --- a/crypto/x509/x509_cmp.c +++ b/crypto/x509/x509_cmp.c @@ -490,6 +490,8 @@ STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain) STACK_OF(X509) *ret; int i; ret = sk_X509_dup(chain); + if (ret == NULL) + return NULL; for (i = 0; i < sk_X509_num(ret); i++) { X509 *x = sk_X509_value(ret, i); CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); |