Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A73F410A83 for ; Wed, 6 Nov 2013 21:59:52 +0000 (UTC) Received: (qmail 14529 invoked by uid 500); 6 Nov 2013 21:59:52 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 14507 invoked by uid 500); 6 Nov 2013 21:59:52 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 14500 invoked by uid 99); 6 Nov 2013 21:59:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Nov 2013 21:59:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Nov 2013 21:59:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 37F222388868; Wed, 6 Nov 2013 21:59:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1539474 - /qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp Date: Wed, 06 Nov 2013 21:59:31 -0000 To: commits@qpid.apache.org From: cliffjansen@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131106215931.37F222388868@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cliffjansen Date: Wed Nov 6 21:59:30 2013 New Revision: 1539474 URL: http://svn.apache.org/r1539474 Log: QPID-3502: Windows SslConnector memory error from unititialized data Modified: qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp Modified: qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp?rev=1539474&r1=1539473&r2=1539474&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp Wed Nov 6 21:59:30 2013 @@ -116,8 +116,9 @@ SslConnector::SslConnector(boost::shared framing::ProtocolVersion ver, const ConnectionSettings& settings, ConnectionImpl* cimpl) - : TCPConnector(p, ver, settings, cimpl), shim(0), poller(p) + : TCPConnector(p, ver, settings, cimpl), shim(0), poller(p), certStore(0), cert(0) { + SecInvalidateHandle(&credHandle); memset(&cred, 0, sizeof(cred)); cred.dwVersion = SCHANNEL_CRED_VERSION; @@ -149,10 +150,12 @@ SslConnector::SslConnector(boost::shared SslConnector::~SslConnector() { + if (SecIsValidHandle(&credHandle)) + ::FreeCredentialsHandle(&credHandle); if (cert) ::CertFreeCertificateContext(cert); - ::CertCloseStore(certStore, CERT_CLOSE_STORE_FORCE_FLAG); - ::FreeCredentialsHandle(&credHandle); + if (certStore) + ::CertCloseStore(certStore, CERT_CLOSE_STORE_FORCE_FLAG); } void SslConnector::connect(const std::string& host, const std::string& port) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org