[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

bweinstein at apple.com bweinstein at apple.com
Fri Jan 21 14:39:04 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 68b9f5f4cbed3ec0d955693a1dc8a4199f1df29b
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 23 23:36:16 2010 +0000

    Assertion when loading www.yahoo.com in WebKit2 under decodeResourceRequest
    https://bugs.webkit.org/show_bug.cgi?id=51562
    
    Reviewed by Anders Carlsson.
    
    Don't assert that our data reference isn't empty when we try to get the data from it.
    If it is empty, just return 0.
    
    All callers are safe with this function returning 0.
    
    * Platform/CoreIPC/DataReference.h:
    (CoreIPC::DataReference::data): Change the assert to an early return.
    * Shared/cf/ArgumentCodersCF.cpp:
    (CoreIPC::decode): Add an assert, and remove a ternarny operator because the function now does
        this for us (if the data is empty, return 0).
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74588 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index b2591ca..2c0f774 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-23  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Assertion when loading www.yahoo.com in WebKit2 under decodeResourceRequest
+        https://bugs.webkit.org/show_bug.cgi?id=51562
+        
+        Don't assert that our data reference isn't empty when we try to get the data from it.
+        If it is empty, just return 0.
+        
+        All callers are safe with this function returning 0.
+
+        * Platform/CoreIPC/DataReference.h:
+        (CoreIPC::DataReference::data): Change the assert to an early return.
+        * Shared/cf/ArgumentCodersCF.cpp:
+        (CoreIPC::decode): Add an assert, and remove a ternarny operator because the function now does
+            this for us (if the data is empty, return 0).
+
 2010-12-23  Sam Weinig  <sam at webkit.org>
 
         Fix incorrect assertion causing all pages with subframes to crash.
diff --git a/WebKit2/Platform/CoreIPC/DataReference.h b/WebKit2/Platform/CoreIPC/DataReference.h
index 5ecb8ea..1657bea 100644
--- a/WebKit2/Platform/CoreIPC/DataReference.h
+++ b/WebKit2/Platform/CoreIPC/DataReference.h
@@ -52,8 +52,8 @@ public:
     size_t size() const { return m_size; }
     const uint8_t* data() const 
     { 
-        ASSERT(!isEmpty());
-        
+        if (isEmpty())
+            return 0;
         return m_data; 
     }
 
diff --git a/WebKit2/Shared/cf/ArgumentCodersCF.cpp b/WebKit2/Shared/cf/ArgumentCodersCF.cpp
index 2d4e339..4edf46f 100644
--- a/WebKit2/Shared/cf/ArgumentCodersCF.cpp
+++ b/WebKit2/Shared/cf/ArgumentCodersCF.cpp
@@ -378,6 +378,7 @@ bool decode(ArgumentDecoder* decoder, RetainPtr<CFNumberRef>& result)
     if (!neededBufferSize || dataReference.size() != neededBufferSize)
         return false;
 
+    ASSERT(dataReference.data());
     CFNumberRef number = CFNumberCreate(0, numberType, dataReference.data());
     result.adoptCF(number);
 
@@ -416,7 +417,7 @@ bool decode(ArgumentDecoder* decoder, RetainPtr<CFStringRef>& result)
     if (!decoder->decode(dataReference))
         return false;
 
-    CFStringRef string = CFStringCreateWithBytes(0, dataReference.isEmpty() ? 0 : dataReference.data(), dataReference.size(), encoding, false);
+    CFStringRef string = CFStringCreateWithBytes(0, dataReference.data(), dataReference.size(), encoding, false);
     if (!string)
         return false;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list