parsing error caused segfault in destroy()
authorAndreas Steffen <andreas@strongswan.org>
Sun, 13 Sep 2009 18:56:12 +0000 (20:56 +0200)
committerAndreas Steffen <andreas@strongswan.org>
Sun, 13 Sep 2009 18:56:12 +0000 (20:56 +0200)
src/libstrongswan/plugins/x509/x509_cert.c

index bfb3d11..108d7b2 100644 (file)
@@ -1463,9 +1463,9 @@ x509_cert_t *x509_cert_load(certificate_type_t type, va_list args)
                private_x509_cert_t *cert = create_empty();
 
                cert->encoding = chunk_clone(blob);
+               cert->parsed = TRUE;
                if (parse_certificate(cert))
                {
-                       cert->parsed = TRUE;
                        return &cert->public;
                }
                destroy(cert);