[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

aroben at apple.com aroben at apple.com
Wed Dec 22 13:47:40 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 48ea0be228d6a1ce17214553e0e89499de154ece
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 27 13:28:14 2010 +0000

    Don't double-free CERT_CONTEXTs when copying PlatformCertificateInfos on Windows
    
    Fixes <http://webkit.org/b/46536> <rdar://problem/8477292> REGRESSION
    (r68260): Crash in PlatformCertificateInfo::~PlatformCertificateInfo
    when navigating away from Gmail
    
    Reviewed by Sam Weinig.
    
    * Shared/win/PlatformCertificateInfo.cpp:
    (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
    (WebKit::PlatformCertificateInfo::operator=):
    * Shared/win/PlatformCertificateInfo.h:
    Added a copy constructor and assigment operator to handle correctly
    reffing/dereffing the CERT_CONTEXTs when copying a
    PlatformCertificateInfo.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68387 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 1c652ea..acabefc 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-27  Adam Roben  <aroben at apple.com>
+
+        Don't double-free CERT_CONTEXTs when copying PlatformCertificateInfos
+        on Windows
+
+        Fixes <http://webkit.org/b/46536> <rdar://problem/8477292> REGRESSION
+        (r68260): Crash in PlatformCertificateInfo::~PlatformCertificateInfo
+        when navigating away from Gmail
+
+        Reviewed by Sam Weinig.
+
+        * Shared/win/PlatformCertificateInfo.cpp:
+        (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
+        (WebKit::PlatformCertificateInfo::operator=):
+        * Shared/win/PlatformCertificateInfo.h:
+        Added a copy constructor and assigment operator to handle correctly
+        reffing/dereffing the CERT_CONTEXTs when copying a
+        PlatformCertificateInfo.
+
 2010-09-26  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Simon Fraser.
diff --git a/WebKit2/Shared/win/PlatformCertificateInfo.cpp b/WebKit2/Shared/win/PlatformCertificateInfo.cpp
index f6e4249..5b9a2c9 100644
--- a/WebKit2/Shared/win/PlatformCertificateInfo.cpp
+++ b/WebKit2/Shared/win/PlatformCertificateInfo.cpp
@@ -63,6 +63,20 @@ PlatformCertificateInfo::~PlatformCertificateInfo()
         ::CertFreeCertificateContext(m_certificateContext);
 }
 
+PlatformCertificateInfo::PlatformCertificateInfo(const PlatformCertificateInfo& other)
+    : m_certificateContext(::CertDuplicateCertificateContext(other.m_certificateContext))
+{
+}
+
+PlatformCertificateInfo& PlatformCertificateInfo::operator=(const PlatformCertificateInfo& other)
+{
+    ::CertDuplicateCertificateContext(other.m_certificateContext);
+    if (m_certificateContext)
+        ::CertFreeCertificateContext(m_certificateContext);
+    m_certificateContext = other.m_certificateContext;
+    return *this;
+}
+
 void PlatformCertificateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
     // FIXME: We should encode the no certificate context case in the
diff --git a/WebKit2/Shared/win/PlatformCertificateInfo.h b/WebKit2/Shared/win/PlatformCertificateInfo.h
index 1537f57..b8d6d6d 100644
--- a/WebKit2/Shared/win/PlatformCertificateInfo.h
+++ b/WebKit2/Shared/win/PlatformCertificateInfo.h
@@ -43,6 +43,9 @@ public:
     explicit PlatformCertificateInfo(const WebCore::ResourceResponse&);    
     ~PlatformCertificateInfo();
 
+    PlatformCertificateInfo(const PlatformCertificateInfo&);
+    PlatformCertificateInfo& operator=(const PlatformCertificateInfo&);
+
     PCCERT_CONTEXT certificateContext() const { return m_certificateContext; }
 
     void encode(CoreIPC::ArgumentEncoder* encoder) const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list