Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1571233003: Fix errors caused by unsafe conversions to/from size_t (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved ALLOW_NUMERIC_ARG_TYPES_PROMOTABLE_TO Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index 10fb6fd5a134ca267042b6e8bfddd1a4c3dfd3de..dd7569f3e53c37b40a72e1da283df5298df1ab42 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -361,7 +361,7 @@ DOMArrayBuffer* XMLHttpRequest::responseArrayBuffer()
if (!m_responseArrayBuffer) {
if (m_binaryResponseBuilder && m_binaryResponseBuilder->size()) {
RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::createUninitialized(m_binaryResponseBuilder->size(), 1);
- if (!m_binaryResponseBuilder->getAsBytes(buffer->data(), buffer->byteLength())) {
+ if (!m_binaryResponseBuilder->getAsBytes(buffer->data(), static_cast<size_t>(buffer->byteLength()))) {
// m_binaryResponseBuilder failed to allocate an ArrayBuffer.
// We need to crash the renderer since there's no way defined in
// the spec to tell this to the user.
« no previous file with comments | « third_party/WebKit/Source/core/xml/parser/SharedBufferReader.cpp ('k') | third_party/WebKit/Source/platform/SharedBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698