Title: [213797] releases/WebKitGTK/webkit-2.16/Source/WTF
Revision
213797
Author
[email protected]
Date
2017-03-13 02:48:07 -0700 (Mon, 13 Mar 2017)

Log Message

Merge r213223 - [WTF] va_list is not ended in StringPrintStream
https://bugs.webkit.org/show_bug.cgi?id=169035

Reviewed by Michael Saboff.

Also fix whitespace errors while touching this file.

* wtf/StringPrintStream.cpp:
(WTF::StringPrintStream::vprintf):
(WTF::StringPrintStream::increaseSize):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.16/Source/WTF/ChangeLog (213796 => 213797)


--- releases/WebKitGTK/webkit-2.16/Source/WTF/ChangeLog	2017-03-13 09:46:42 UTC (rev 213796)
+++ releases/WebKitGTK/webkit-2.16/Source/WTF/ChangeLog	2017-03-13 09:48:07 UTC (rev 213797)
@@ -1,3 +1,16 @@
+2017-03-01  Tomas Popela  <[email protected]>
+
+        [WTF] va_list is not ended in StringPrintStream
+        https://bugs.webkit.org/show_bug.cgi?id=169035
+
+        Reviewed by Michael Saboff.
+
+        Also fix whitespace errors while touching this file.
+
+        * wtf/StringPrintStream.cpp:
+        (WTF::StringPrintStream::vprintf):
+        (WTF::StringPrintStream::increaseSize):
+
 2017-02-22  Carlos Garcia Campos  <[email protected]>
 
         Better handle Thread and RunLoop initialization

Modified: releases/WebKitGTK/webkit-2.16/Source/WTF/wtf/StringPrintStream.cpp (213796 => 213797)


--- releases/WebKitGTK/webkit-2.16/Source/WTF/wtf/StringPrintStream.cpp	2017-03-13 09:46:42 UTC (rev 213796)
+++ releases/WebKitGTK/webkit-2.16/Source/WTF/wtf/StringPrintStream.cpp	2017-03-13 09:48:07 UTC (rev 213797)
@@ -20,7 +20,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -52,32 +52,34 @@
 {
     ASSERT_WITH_SECURITY_IMPLICATION(m_next < m_size);
     ASSERT(!m_buffer[m_next]);
-    
+
     va_list firstPassArgList;
     va_copy(firstPassArgList, argList);
-    
+
     int numberOfBytesNotIncludingTerminatorThatWouldHaveBeenWritten =
         vsnprintf(m_buffer + m_next, m_size - m_next, format, firstPassArgList);
-    
+
+    va_end(firstPassArgList);
+
     int numberOfBytesThatWouldHaveBeenWritten =
         numberOfBytesNotIncludingTerminatorThatWouldHaveBeenWritten + 1;
-    
+
     if (m_next + numberOfBytesThatWouldHaveBeenWritten <= m_size) {
         m_next += numberOfBytesNotIncludingTerminatorThatWouldHaveBeenWritten;
         return; // This means that vsnprintf() succeeded.
     }
-    
+
     increaseSize(m_next + numberOfBytesThatWouldHaveBeenWritten);
-    
+
     int numberOfBytesNotIncludingTerminatorThatWereWritten =
         vsnprintf(m_buffer + m_next, m_size - m_next, format, argList);
-    
+
     int numberOfBytesThatWereWritten = numberOfBytesNotIncludingTerminatorThatWereWritten + 1;
-    
+
     ASSERT_UNUSED(numberOfBytesThatWereWritten, m_next + numberOfBytesThatWereWritten <= m_size);
-    
+
     m_next += numberOfBytesNotIncludingTerminatorThatWereWritten;
-    
+
     ASSERT_WITH_SECURITY_IMPLICATION(m_next < m_size);
     ASSERT(!m_buffer[m_next]);
 }
@@ -110,10 +112,10 @@
 {
     ASSERT_WITH_SECURITY_IMPLICATION(newSize > m_size);
     ASSERT(newSize > sizeof(m_inlineBuffer));
-    
+
     // Use exponential resizing to reduce thrashing.
     m_size = newSize << 1;
-    
+
     // Use fastMalloc instead of fastRealloc because we know that for the sizes we're using,
     // fastRealloc will just do malloc+free anyway. Also, this simplifies the code since
     // we can't realloc the inline buffer.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to