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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 133123006: Validate vector lengths in ImageHostMsg_DidDownloadImage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Kill the renderer on a bad message Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 23dfc68b3549ce8d9c24e15c456919f0c601d467..3d1da2c3095aa49db4e3630b9284245bfda67195 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2511,6 +2511,11 @@ void WebContentsImpl::OnDidDownloadImage(
const GURL& image_url,
const std::vector<SkBitmap>& bitmaps,
const std::vector<gfx::Size>& original_bitmap_sizes) {
+ if (bitmaps.size() != original_bitmap_sizes.size()) {
+ GetRenderProcessHost()->ReceivedBadMessage();
+ return;
+ }
+
ImageDownloadMap::iterator iter = image_download_map_.find(id);
if (iter == image_download_map_.end()) {
// Currently WebContents notifies us of ANY downloads so that it is
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698