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

Unified Diff: content/common/cursors/webcursor.cc

Issue 1498903003: Fix a overflow in WebCursorn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/common/cursors/webcursor.cc
diff --git a/content/common/cursors/webcursor.cc b/content/common/cursors/webcursor.cc
index faa6d703b4f53169468556fe15d596ca0c1ad33e..b2dfcdf0aaaf0ccca777445bfdb9479494bc99c9 100644
--- a/content/common/cursors/webcursor.cc
+++ b/content/common/cursors/webcursor.cc
@@ -112,8 +112,12 @@ bool WebCursor::Deserialize(base::PickleIterator* iter) {
if (size_x > 0 && size_y > 0) {
// The * 4 is because the expected format is an array of RGBA pixel
// values.
- if (size_x * size_y * 4 > data_len)
+ if (size_x * size_y * 4 != data_len) {
+ LOG(WARNING) << "WebCursor's data length and image size mismatch: "
+ << size_x << "x" << size_y << "x4 != "
+ << data_len;
return false;
+ }
hotspot_.set_x(hotspot_x);
hotspot_.set_y(hotspot_y);
« 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