From: David Woodhouse Date: Wed, 26 Sep 2012 19:09:17 +0000 (+0100) Subject: Fix potential NULL dereference in error path in gnutls_pkcs11_simple_parse() X-Git-Tag: v4.08~22 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a2454d455e29d43bdec544edde93f5d5ffc0720e;p=users%2Fdwmw2%2Fopenconnect.git Fix potential NULL dereference in error path in gnutls_pkcs11_simple_parse() Spotted by Coverity. Also fixed in GnuTLS already in commit 6aca5dd7. Signed-off-by: David Woodhouse --- diff --git a/gnutls_pkcs12.c b/gnutls_pkcs12.c index c2e76659..7da1c9cd 100644 --- a/gnutls_pkcs12.c +++ b/gnutls_pkcs12.c @@ -502,7 +502,7 @@ done: gnutls_x509_crt_deinit(_extra_certs[i]); gnutls_free(_extra_certs); } - if (_chain_len && chain != NULL) + if (_chain_len && _chain != NULL) { unsigned int i; for (i = 0; i < _chain_len; i++)