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

Issue 188693007: Added checks for integer overflow conditions to deleteData and replaceData.

Created:
6 years, 9 months ago by jbutler
Modified:
6 years, 9 months ago
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Inactive, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Added checks for integer overflow conditions to deleteData and replaceData. Also optimised the multiple calls to length() into a single call at the beginning of both functions. Finally, as requested, I modified the assertion I was hitting to indicate it has a security implication. BUG=349898

Patch Set 1 #

Patch Set 2 : Added layout tests #

Patch Set 3 : Updated layout tests #

Patch Set 4 : Fixed typo #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -7 lines) Patch
A LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html View 1 2 1 chunk +39 lines, -0 lines 1 comment Download
A LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow-expected.txt View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/dom/CharacterData.cpp View 2 chunks +20 lines, -6 lines 1 comment Download
M Source/core/editing/FrameSelection.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
jbutler
6 years, 9 months ago (2014-03-06 20:51:59 UTC) #1
enne (OOO)
I don't really know this code. Naively, this lgtm, but maybe there's a better reviewer.
6 years, 9 months ago (2014-03-06 21:39:29 UTC) #2
jbutler
On 2014/03/06 21:39:29, enne wrote: > I don't really know this code. Naively, this lgtm, ...
6 years, 9 months ago (2014-03-06 22:28:59 UTC) #3
enne (OOO)
+eseidel, based on git log of CharacterData.cpp
6 years, 9 months ago (2014-03-06 22:33:14 UTC) #4
eseidel
lgtm
6 years, 9 months ago (2014-03-06 23:41:27 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jbutler@chromium.org/188693007/20001
6 years, 9 months ago (2014-03-06 23:42:09 UTC) #6
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-07 00:22:46 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel
6 years, 9 months ago (2014-03-07 00:22:47 UTC) #8
jbutler
Updated layout tests, and confirmed they pass on my setup.
6 years, 9 months ago (2014-03-07 11:24:53 UTC) #9
jbutler
On 2014/03/07 11:24:53, jbutler wrote: > Updated layout tests, and confirmed they pass on my ...
6 years, 9 months ago (2014-03-16 10:08:57 UTC) #10
eseidel
lgtm
6 years, 9 months ago (2014-03-16 20:43:29 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jbutler@chromium.org/188693007/60001
6 years, 9 months ago (2014-03-16 20:43:34 UTC) #12
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-16 21:15:06 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_rel
6 years, 9 months ago (2014-03-16 21:15:07 UTC) #14
sof
This looks like it breaks the spec (step 3), http://dom.spec.whatwg.org/#concept-cd-replace i.e., the overflow condition shouldn't ...
6 years, 9 months ago (2014-03-16 21:17:20 UTC) #15
Inactive
https://codereview.chromium.org/188693007/diff/60001/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html File LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html (right): https://codereview.chromium.org/188693007/diff/60001/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html#newcode28 LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html:28: try { It would also be nice if this ...
6 years, 9 months ago (2014-03-17 00:04:32 UTC) #16
jbutler
On 2014/03/17 00:04:32, Chris Dumez wrote: > https://codereview.chromium.org/188693007/diff/60001/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html > File LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html > (right): > > ...
6 years, 9 months ago (2014-03-17 07:34:25 UTC) #17
sof
6 years, 9 months ago (2014-03-19 11:40:18 UTC) #18
https://codereview.chromium.org/188693007/diff/60001/Source/core/dom/Characte...
File Source/core/dom/CharacterData.cpp (right):

https://codereview.chromium.org/188693007/diff/60001/Source/core/dom/Characte...
Source/core/dom/CharacterData.cpp:118: if (count > (dataLength - offset)) {
If not already, you may want to consider handling overflow checking using
Checked<unsigned, OverflowHandler> instead.

Powered by Google App Engine
This is Rietveld 408576698