Title: [167227] releases/WebKitGTK/webkit-2.4/Source/WTF
Revision
167227
Author
carlo...@webkit.org
Date
2014-04-14 02:31:32 -0700 (Mon, 14 Apr 2014)

Log Message

Merge r164408 - Crash in WTF::StringBuilder::append()

https://bugs.webkit.org/show_bug.cgi?id=125817
<rdar://problem/15671883>

Reviewed by Oliver Hunt.

* wtf/text/StringBuilder.cpp:
(WTF::expandedCapacity):
Ensure that we return a new capacity of at least 'requiredLength' in
the case where requiredLength is large. Also, use unsigned rather than
size_t for the parameters and the return value, as callers pass
unsigned arguments and treat the result as an unsigned int.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog (167226 => 167227)


--- releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog	2014-04-14 09:24:16 UTC (rev 167226)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog	2014-04-14 09:31:32 UTC (rev 167227)
@@ -1,3 +1,19 @@
+2014-02-19  Jon Honeycutt  <jhoneyc...@apple.com>
+
+        Crash in WTF::StringBuilder::append()
+
+        https://bugs.webkit.org/show_bug.cgi?id=125817
+        <rdar://problem/15671883>
+
+        Reviewed by Oliver Hunt.
+
+        * wtf/text/StringBuilder.cpp:
+        (WTF::expandedCapacity):
+        Ensure that we return a new capacity of at least 'requiredLength' in
+        the case where requiredLength is large. Also, use unsigned rather than
+        size_t for the parameters and the return value, as callers pass
+        unsigned arguments and treat the result as an unsigned int.
+
 2014-02-17  Ryan Lortie  <de...@desrt.ca>
 
         Enable DFG_JIT on FreeBSD

Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/text/StringBuilder.cpp (167226 => 167227)


--- releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/text/StringBuilder.cpp	2014-04-14 09:24:16 UTC (rev 167226)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/text/StringBuilder.cpp	2014-04-14 09:31:32 UTC (rev 167227)
@@ -33,10 +33,10 @@
 
 namespace WTF {
 
-static size_t expandedCapacity(size_t capacity, size_t newLength)
+static unsigned expandedCapacity(unsigned capacity, unsigned requiredLength)
 {
-    static const size_t minimumCapacity = 16;
-    return std::max(capacity, std::max(minimumCapacity, newLength * 2));
+    static const unsigned minimumCapacity = 16;
+    return std::max(requiredLength, std::max(minimumCapacity, capacity * 2));
 }
 
 void StringBuilder::reifyString() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to