Skip to content

Commit 19e3bbd

Browse files
committed
Cherry-pick fix for WebCursor security issue
Fix an overflow in WebCursor. I also added log message just in case a user has an issue with erroneous but unmalicious web cursor. BUG=565023 Review URL: https://codereview.chromium.org/1498903003 Change-Id: I1749faa42072739525028762b8435d33ed3c61c8 Reviewed-by: Joerg Bornemann <[email protected]> Reviewed-by: Michael Brüning <[email protected]>
1 parent 0281cc9 commit 19e3bbd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

chromium/content/common/cursors/webcursor.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ bool WebCursor::Deserialize(PickleIterator* iter) {
112112
if (size_x > 0 && size_y > 0) {
113113
// The * 4 is because the expected format is an array of RGBA pixel
114114
// values.
115-
if (size_x * size_y * 4 > data_len)
115+
if (size_x * size_y * 4 != data_len) {
116+
LOG(WARNING) << "WebCursor's data length and image size mismatch: "
117+
<< size_x << "x" << size_y << "x4 != "
118+
<< data_len;
116119
return false;
120+
}
117121

118122
hotspot_.set_x(hotspot_x);
119123
hotspot_.set_y(hotspot_y);

0 commit comments

Comments
 (0)