fix segfault when reading certificate from smartcard

This commit is contained in:
Egbert Koening
2010-10-15 11:09:38 +02:00
committed by Andreas Steffen
parent d3622166dd
commit 4de8398f93
+2 -1
View File
@@ -874,7 +874,8 @@ static void load_end_certificate(char *filename, struct end *dst)
/* cache the certificate that was last retrieved from the smartcard */
if (dst->sc)
{
if (!certificate->equals(certificate, dst->sc->last_cert->cert))
if (!dst->sc->last_cert ||
!certificate->equals(certificate, dst->sc->last_cert->cert))
{
lock_certs_and_keys("load_end_certificates");
cert_release(dst->sc->last_cert);