aboutsummaryrefslogtreecommitdiffstats
path: root/src/pluto/connections.c
diff options
context:
space:
mode:
authorEgbert Koening <e.kunig@home.nl>2010-10-15 11:09:24 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-10-15 11:09:38 +0200
commit4de8398f931e1777c685710c87ad412bcf6715c4 (patch)
treef6ab4feebf6a8736a810f59f4e0bbcef19f09162 /src/pluto/connections.c
parentd3622166dd0ce4670e2a2a8967198ac50b77d2d3 (diff)
downloadstrongswan-4de8398f931e1777c685710c87ad412bcf6715c4.tar.bz2
strongswan-4de8398f931e1777c685710c87ad412bcf6715c4.tar.xz
fix segfault when reading certificate from smartcard
Diffstat (limited to 'src/pluto/connections.c')
-rw-r--r--src/pluto/connections.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pluto/connections.c b/src/pluto/connections.c
index 2a3421961..9f277e135 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);