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

cevans at google.com cevans at google.com
Wed Dec 22 14:21:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 23693b8b34b116fe3bb9ed85bb212d77928899d5
Author: cevans at google.com <cevans at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 7 05:42:04 2010 +0000

    2010-10-06  Chris Evans  <cevans at google.com>
    
            Reviewed by David Levin.
    
            https://bugs.webkit.org/show_bug.cgi?id=47313
    
            Fix integer errors with enormous input strings to newline normalization APIs.
    
            * platform/text/LineEnding.cpp:
            (WebCore::normalizeLineEndingsToCRLF): return the empty string upon huge input strings. (Behaves similarly to base64Encode now).
            (WebCore::normalizeToCROrLF): use the correct type for a string length.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69275 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e00f707..f6e996b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-06  Chris Evans  <cevans at google.com>
+
+        Reviewed by David Levin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=47313
+
+        Fix integer errors with enormous input strings to newline normalization APIs.
+
+        * platform/text/LineEnding.cpp:
+        (WebCore::normalizeLineEndingsToCRLF): return the empty string upon huge input strings. (Behaves similarly to base64Encode now).
+        (WebCore::normalizeToCROrLF): use the correct type for a string length.
+
 2010-10-06  Kent Tamura  <tkent at chromium.org>
 
         Unreviewed, build fix.
diff --git a/WebCore/platform/text/LineEnding.cpp b/WebCore/platform/text/LineEnding.cpp
index 545f22b..17a9786 100644
--- a/WebCore/platform/text/LineEnding.cpp
+++ b/WebCore/platform/text/LineEnding.cpp
@@ -40,7 +40,7 @@ namespace WebCore {
 // Normalize all line-endings to CRLF.
 CString normalizeLineEndingsToCRLF(const CString& from)
 {
-    unsigned newLen = 0;
+    size_t newLen = 0;
     const char* p = from.data();
     while (char c = *p++) {
         if (c == '\r') {
@@ -59,6 +59,8 @@ CString normalizeLineEndingsToCRLF(const CString& from)
     }
     if (newLen == from.length())
         return from;
+    if (newLen < from.length())
+        return CString();
 
     // Make a copy of the string.
     p = from.data();
@@ -87,7 +89,7 @@ CString normalizeLineEndingsToCRLF(const CString& from)
 // Normalize all line-endings to CR or LF.
 static CString normalizeToCROrLF(const CString& from, bool toCR)
 {
-    unsigned newLen = 0;
+    size_t newLen = 0;
     bool needFix = false;
     const char* p = from.data();
     char fromEndingChar = toCR ? '\n' : '\r';

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list