]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
polish a little the latest "ssl_crtd crashes on long domain names" patch
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Sat, 3 Mar 2012 06:30:56 +0000 (08:30 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Sat, 3 Mar 2012 06:30:56 +0000 (08:30 +0200)
src/ssl/gadgets.cc

index 4d23f87d3d57c2d15d910500a66c47efd2885c2a..01c6352c67eadbea5f5fad7231200c9bc507ab3c 100644 (file)
@@ -229,8 +229,8 @@ static bool buildCertificate(Ssl::X509_Pointer & cert, Ssl::CertificatePropertie
     // not an Ssl::X509_NAME_Pointer because X509_REQ_get_subject_name()
     // returns a pointer to the existing subject name. Nothing to clean here.
     if (properties.mimicCert.get()) {
-        X509_NAME *name = X509_get_subject_name(properties.mimicCert.get());
-        if (name) {
+        // Leave subject empty if we cannot extract it from true cert.
+        if (X509_NAME *name = X509_get_subject_name(properties.mimicCert.get())) {
             // X509_set_subject_name will call X509_dup for name 
             X509_set_subject_name(cert.get(), name);
         }