diff --git a/src/tqca.cpp b/src/tqca.cpp index 3ff9a58..8eb7bb5 100644 --- a/src/tqca.cpp +++ b/src/tqca.cpp @@ -696,6 +696,7 @@ public: Cert::Cert() { d = new Private; + // crash because this is returning 0 d->c = (TQCA_CertContext *)getContext(CAP_X509); } @@ -708,7 +709,10 @@ Cert::Cert(const Cert &from) Cert & Cert::operator=(const Cert &from) { delete d->c; - d->c = from.d->c->clone(); + if ( from.d->c ) + d->c = from.d->c->clone(); + else + d->c = 0; return *this; } @@ -837,6 +841,7 @@ public: to_net.resize(0); host = ""; hostMismatch = false; + // this causes the crash, because the Cert ctor is setting a null context cert = Cert(); bytesEncoded = 0; tryMore = false;