From: Egbert Koening Date: Fri, 15 Oct 2010 09:09:24 +0000 (+0200) Subject: fix segfault when reading certificate from smartcard X-Git-Tag: 4.5.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4de8398f931e1777c685710c87ad412bcf6715c4;p=thirdparty%2Fstrongswan.git fix segfault when reading certificate from smartcard --- diff --git a/src/pluto/connections.c b/src/pluto/connections.c index 2a34219611..9f277e135f 100644 --- a/src/pluto/connections.c +++ b/src/pluto/connections.c @@ -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);