[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:39:08 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b7aeae145485966649d0c674421ff241ca5549ca
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Apr 29 15:19:46 2003 +0000

            Reviewed by Ken.
    
    	- fixed 3230885 -- crash loading hixie test page in -[WebSubresourceClient connection:didReceiveData:]
    
            * khtml/rendering/render_style.cpp: (RenderStyle::setContent):
            Change code around so we don't deref the text object without checking
            the contentType. Also fix the leak of a DOMStringImpl in the case
            where we are asked to add a string, but the string pointer is 0.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4204 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 9ebf795..98381f6 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,14 @@
+2003-04-29  Darin Adler  <darin at apple.com>
+
+        Reviewed by Ken.
+
+	- fixed 3230885 -- crash loading hixie test page in -[WebSubresourceClient connection:didReceiveData:]
+
+        * khtml/rendering/render_style.cpp: (RenderStyle::setContent):
+        Change code around so we don't deref the text object without checking
+        the contentType. Also fix the leak of a DOMStringImpl in the case
+        where we are asked to add a string, but the string pointer is 0.
+
 2003-04-28  Richard Williamson  <rjw at apple.com>
 
         API changes from final review meeting.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 9ebf795..98381f6 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,14 @@
+2003-04-29  Darin Adler  <darin at apple.com>
+
+        Reviewed by Ken.
+
+	- fixed 3230885 -- crash loading hixie test page in -[WebSubresourceClient connection:didReceiveData:]
+
+        * khtml/rendering/render_style.cpp: (RenderStyle::setContent):
+        Change code around so we don't deref the text object without checking
+        the contentType. Also fix the leak of a DOMStringImpl in the case
+        where we are asked to add a string, but the string pointer is 0.
+
 2003-04-28  Richard Williamson  <rjw at apple.com>
 
         API changes from final review meeting.
diff --git a/WebCore/khtml/rendering/render_style.cpp b/WebCore/khtml/rendering/render_style.cpp
index 36a7d3a..aea1f59 100644
--- a/WebCore/khtml/rendering/render_style.cpp
+++ b/WebCore/khtml/rendering/render_style.cpp
@@ -30,6 +30,8 @@
 
 using namespace khtml;
 
+using DOM::DOMStringImpl;
+
 StyleSurroundData::StyleSurroundData()
     : margin( Fixed ), padding( Variable )
 {
@@ -468,26 +470,33 @@ void RenderStyle::setClip( Length top, Length right, Length bottom, Length left
     data->clip.left = left;
 }
 
-void RenderStyle::setContent(DOM::DOMStringImpl* s, bool add)
+void RenderStyle::setContent(DOMStringImpl* s, bool add)
 {
-    if ( !content )
-	content = new ContentData;
-    else if (!add)
-	content->clearContent();
-    
-    if (!s)
-        s = new DOM::DOMStringImpl("");
-
-    if (add) {
-        DOM::DOMStringImpl* oldStr = content->_content.text;
-        content->_content.text = oldStr->copy();
-        content->_content.text->append(s);
+    if (add && content && content->_contentType == CONTENT_TEXT) {
+        if (!s)
+            return;
+        
+        DOMStringImpl* oldStr = content->_content.text;
+        DOMStringImpl* newStr = oldStr->copy();
         oldStr->deref();
+        newStr->append(s);
+
+        content->_content.text = newStr;
     }
-    else
-        content->_content.text = s;
+    else {
+        // FIXME: If we try to add a string, and the old content was an object,
+        // then we just clobber the object. This is probably not right, but it's
+        // better than just trashing memory the way this code did before we added
+        // the check of contentType above.
+
+        if (!content)
+            content = new ContentData;
+        else
+            content->clearContent();
+        content->_content.text = s ? s : new DOMStringImpl("");
+    }
+
     content->_content.text->ref();
-        
     content->_contentType = CONTENT_TEXT;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list