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

Issue 1011113003: Fix potential bug in FastSharedBufferReader::getConsecutiveData (Closed)

Created:
5 years, 9 months ago by kbalazs
Modified:
5 years, 8 months ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix potential bug in FastSharedBufferReader::getConsecutiveData The loop has a logical error: it can read the SharedBuffer further after the desired number of bytes already read. This would cause assertion - and other sort of funny things in release - if callers want to read from the end of the next to last segment overlapping to the last one. Besides the fix the unit test went through some refactor. BUG=462733 TEST=readOverlappingLastSegmentBoundary Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193404

Patch Set 1 #

Total comments: 14

Patch Set 2 : fix my bug too... #

Total comments: 9

Patch Set 3 : unrefactor #

Patch Set 4 : messing with consts #

Total comments: 4

Patch Set 5 : last bits #

Patch Set 6 : grammar :) #

Patch Set 7 : more mess with the const... #

Patch Set 8 : refactored test #

Patch Set 9 : buildfix #

Patch Set 10 : back to v6 plus define #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -30 lines) Patch
M Source/config.h View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
M Source/platform/SharedBuffer.h View 1 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M Source/platform/SharedBuffer.cpp View 1 2 3 4 5 6 7 8 9 7 chunks +10 lines, -11 lines 0 comments Download
M Source/platform/image-decoders/FastSharedBufferReader.h View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M Source/platform/image-decoders/FastSharedBufferReader.cpp View 1 2 3 4 1 chunk +15 lines, -12 lines 0 comments Download
M Source/platform/image-decoders/FastSharedBufferReaderTest.cpp View 1 2 8 9 5 chunks +22 lines, -6 lines 0 comments Download

Messages

Total messages: 51 (15 generated)
kbalazs
PTAL
5 years, 9 months ago (2015-03-19 23:43:14 UTC) #3
Alpha Left Google
Good catch. LGTM.
5 years, 9 months ago (2015-03-19 23:52:14 UTC) #4
Peter Kasting
https://codereview.chromium.org/1011113003/diff/1/Source/platform/image-decoders/FastSharedBufferReader.cpp File Source/platform/image-decoders/FastSharedBufferReader.cpp (right): https://codereview.chromium.org/1011113003/diff/1/Source/platform/image-decoders/FastSharedBufferReader.cpp#newcode52 Source/platform/image-decoders/FastSharedBufferReader.cpp:52: // Return a pointer into |m_data| if the request ...
5 years, 9 months ago (2015-03-20 01:10:43 UTC) #5
kbalazs
https://codereview.chromium.org/1011113003/diff/1/Source/platform/image-decoders/FastSharedBufferReader.cpp File Source/platform/image-decoders/FastSharedBufferReader.cpp (right): https://codereview.chromium.org/1011113003/diff/1/Source/platform/image-decoders/FastSharedBufferReader.cpp#newcode52 Source/platform/image-decoders/FastSharedBufferReader.cpp:52: // Return a pointer into |m_data| if the request ...
5 years, 9 months ago (2015-03-20 20:20:43 UTC) #6
Peter Kasting
https://codereview.chromium.org/1011113003/diff/1/Source/platform/image-decoders/FastSharedBufferReader.cpp File Source/platform/image-decoders/FastSharedBufferReader.cpp (right): https://codereview.chromium.org/1011113003/diff/1/Source/platform/image-decoders/FastSharedBufferReader.cpp#newcode52 Source/platform/image-decoders/FastSharedBufferReader.cpp:52: // Return a pointer into |m_data| if the request ...
5 years, 9 months ago (2015-03-20 20:29:34 UTC) #7
kbalazs
> > Are you sure? I read the original code and AFAICT it wouldn't have ...
5 years, 9 months ago (2015-03-20 20:37:44 UTC) #8
Alpha Left Google
On 2015/03/20 20:37:44, kbalazs wrote: > > > > Are you sure? I read the ...
5 years, 9 months ago (2015-03-20 20:41:27 UTC) #9
kbalazs
https://codereview.chromium.org/1011113003/diff/1/Source/platform/image-decoders/FastSharedBufferReader.cpp File Source/platform/image-decoders/FastSharedBufferReader.cpp (right): https://codereview.chromium.org/1011113003/diff/1/Source/platform/image-decoders/FastSharedBufferReader.cpp#newcode63 Source/platform/image-decoders/FastSharedBufferReader.cpp:63: m_dataPosition += copy; I also introduced an error. m_dataPosition ...
5 years, 9 months ago (2015-03-25 19:38:10 UTC) #10
kbalazs
pkasting@chromium.org: PTAL adamk@chromium.org: Please rubber-stamp the platform/ parts
5 years, 9 months ago (2015-03-25 19:41:00 UTC) #12
kbalazs
> mailto:adamk@chromium.org: Please rubber-stamp the platform/ parts I mean the SharedBuffer parts.
5 years, 9 months ago (2015-03-25 19:41:49 UTC) #13
Peter Kasting
https://codereview.chromium.org/1011113003/diff/20001/Source/platform/SharedBuffer.cpp File Source/platform/SharedBuffer.cpp (right): https://codereview.chromium.org/1011113003/diff/20001/Source/platform/SharedBuffer.cpp#newcode51 Source/platform/SharedBuffer.cpp:51: return position & segmentPositionMask; This will be safer if ...
5 years, 9 months ago (2015-03-25 19:53:11 UTC) #14
kbalazs
https://codereview.chromium.org/1011113003/diff/20001/Source/platform/image-decoders/FastSharedBufferReader.cpp File Source/platform/image-decoders/FastSharedBufferReader.cpp (right): https://codereview.chromium.org/1011113003/diff/20001/Source/platform/image-decoders/FastSharedBufferReader.cpp#newcode74 Source/platform/image-decoders/FastSharedBufferReader.cpp:74: dest += copy; On 2015/03/25 19:53:11, Peter Kasting wrote: ...
5 years, 9 months ago (2015-03-25 21:05:19 UTC) #15
Peter Kasting
https://codereview.chromium.org/1011113003/diff/20001/Source/platform/image-decoders/FastSharedBufferReader.cpp File Source/platform/image-decoders/FastSharedBufferReader.cpp (right): https://codereview.chromium.org/1011113003/diff/20001/Source/platform/image-decoders/FastSharedBufferReader.cpp#newcode74 Source/platform/image-decoders/FastSharedBufferReader.cpp:74: dest += copy; On 2015/03/25 21:05:19, kbalazs wrote: > ...
5 years, 9 months ago (2015-03-25 21:10:48 UTC) #16
kbalazs
Comments incorporated, ptal.
5 years, 9 months ago (2015-03-26 19:05:29 UTC) #17
Peter Kasting
LGTM https://codereview.chromium.org/1011113003/diff/60001/Source/platform/image-decoders/FastSharedBufferReader.h File Source/platform/image-decoders/FastSharedBufferReader.h (right): https://codereview.chromium.org/1011113003/diff/60001/Source/platform/image-decoders/FastSharedBufferReader.h#newcode73 Source/platform/image-decoders/FastSharedBufferReader.h:73: void getSomeDataIntoCache(unsigned dataPosition); Nit: getSomeDataInternal() might be a ...
5 years, 9 months ago (2015-03-26 19:37:08 UTC) #18
kbalazs
https://codereview.chromium.org/1011113003/diff/60001/Source/platform/image-decoders/FastSharedBufferReader.h File Source/platform/image-decoders/FastSharedBufferReader.h (right): https://codereview.chromium.org/1011113003/diff/60001/Source/platform/image-decoders/FastSharedBufferReader.h#newcode73 Source/platform/image-decoders/FastSharedBufferReader.h:73: void getSomeDataIntoCache(unsigned dataPosition); On 2015/03/26 19:37:08, Peter Kasting wrote: ...
5 years, 9 months ago (2015-03-26 20:33:11 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1011113003/80001
5 years, 9 months ago (2015-03-26 20:37:46 UTC) #22
Peter Kasting
On 2015/03/26 20:33:11, kbalazs wrote: > https://codereview.chromium.org/1011113003/diff/60001/Source/platform/image-decoders/FastSharedBufferReader.h#newcode82 > Source/platform/image-decoders/FastSharedBufferReader.h:82: // Data position in > |m_data| ...
5 years, 9 months ago (2015-03-26 20:39:15 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: blink_presubmit on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/blink_presubmit/builds/29849)
5 years, 9 months ago (2015-03-26 20:42:50 UTC) #25
kbalazs
On 2015/03/26 20:39:15, Peter Kasting wrote: > On 2015/03/26 20:33:11, kbalazs wrote: > > > ...
5 years, 9 months ago (2015-03-26 20:45:32 UTC) #26
Peter Kasting
On 2015/03/26 20:45:32, kbalazs wrote: > On 2015/03/26 20:39:15, Peter Kasting wrote: > > On ...
5 years, 9 months ago (2015-03-26 20:46:52 UTC) #27
pdr.
lgtm
5 years, 8 months ago (2015-03-27 20:53:19 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1011113003/100001
5 years, 8 months ago (2015-03-27 20:53:33 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_compile_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/win_blink_compile_dbg/builds/40712)
5 years, 8 months ago (2015-03-27 21:19:48 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1011113003/120001
5 years, 8 months ago (2015-04-01 19:50:51 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_compile_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/win_blink_compile_dbg/builds/41220)
5 years, 8 months ago (2015-04-01 20:23:54 UTC) #39
kbalazs
Could you guys help me a bit with this freaky constant? First I was thinking ...
5 years, 8 months ago (2015-04-01 21:43:08 UTC) #40
kbalazs
I choose to refactor the test case. Please make a final rubber-stamp.
5 years, 8 months ago (2015-04-06 20:58:44 UTC) #41
pdr.
On 2015/04/06 at 20:58:44, b.kelemen wrote: > I choose to refactor the test case. Please ...
5 years, 8 months ago (2015-04-07 23:19:11 UTC) #42
Peter Kasting
On 2015/04/01 21:43:08, kbalazs wrote: > Could you guys help me a bit with this ...
5 years, 8 months ago (2015-04-07 23:54:26 UTC) #43
kbalazs
On 2015/04/07 23:54:26, Peter Kasting wrote: > On 2015/04/01 21:43:08, kbalazs wrote: > > Could ...
5 years, 8 months ago (2015-04-08 15:45:58 UTC) #44
Peter Kasting
On 2015/04/08 15:45:58, kbalazs wrote: > STATIC_CONST_MEMBER_DEFINITION is a chromium (base) thingy, there is no ...
5 years, 8 months ago (2015-04-08 21:02:09 UTC) #45
kbalazs
On 2015/04/08 21:02:09, Peter Kasting wrote: > On 2015/04/08 15:45:58, kbalazs wrote: > > STATIC_CONST_MEMBER_DEFINITION ...
5 years, 8 months ago (2015-04-08 21:57:43 UTC) #46
Peter Kasting
LGTM
5 years, 8 months ago (2015-04-08 22:02:50 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1011113003/180001
5 years, 8 months ago (2015-04-08 22:08:28 UTC) #50
commit-bot: I haz the power
5 years, 8 months ago (2015-04-09 00:20:16 UTC) #51
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=193404

Powered by Google App Engine
This is Rietveld 408576698