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

Unified Diff: Source/core/html/ImageDocument.cpp

Issue 618583002: Correct data size argument type in resource loading path to unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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: Source/core/html/ImageDocument.cpp
diff --git a/Source/core/html/ImageDocument.cpp b/Source/core/html/ImageDocument.cpp
index ee0542a0943d1b38d4bde7e45f9885258fe77171..c4c4de4da90e9e7382dcf405a99502dd4e87de6a 100644
--- a/Source/core/html/ImageDocument.cpp
+++ b/Source/core/html/ImageDocument.cpp
@@ -43,6 +43,7 @@
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
#include "wtf/text/StringBuilder.h"
+#include <limits.h>
using std::min;
@@ -128,8 +129,10 @@ void ImageDocumentParser::appendBytes(const char* data, size_t length)
if (!frame->loader().client()->allowImage(!settings || settings->imagesEnabled(), document()->url()))
return;
- if (document()->cachedImage())
+ if (document()->cachedImage()) {
+ ASSERT(length <= UINT_MAX);
kouhei (in TOK) 2014/09/30 07:23:03 Can we have more reasonable limit for this?
kouhei (in TOK) 2014/09/30 07:41:22 RELEASE_ASSERT(length <= std::numeric_limits<unsig
tyoshino (SeeGerritForStatus) 2014/09/30 08:14:28 Done.
document()->cachedImage()->appendData(data, length);
+ }
// Make sure the image renderer gets created because we need the renderer
// to read the aspect ratio. See crbug.com/320244
document()->updateRenderTreeIfNeeded();

Powered by Google App Engine
This is Rietveld 408576698