Mojo: Fix possibly-invalid vector subscripting in RawChannelPosix.
In RawChannelPosix::OnFileCanReadWithoutBlocking()'s call to memmove(), read_buffer_start may point one past the end of the buffer. This isn't a "real" problem, since in that case read_buffer_num_valid_bytes_ will be zero, but it's illegal to subscript a vector with an invalid index and an assertion fails in Debug builds (an alternate fix would be to replace &read_buffer_[read_buffer_start] with &read_buffer_[0] + read_buffer_start). The bug was exhibited by the flakily-failing MultiprocessMessagePipeTest.QueueMessages (in Debug builds), so to test run: out/Debug/mojo_system_unittests \ --gtest_filter=MultiprocessMessagePipeTest.QueueMessages \ --gtest_repeat=-1 --single-process-tests R=darin@chromium.org BUG=329622 Review URL: https://codereview.chromium.org/132173003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244194 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment