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

Side by Side Diff: chrome/common/partial_circular_buffer.h

Issue 1061053002: Fix PartialCircularBuffer OOB memcpy(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 8 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ 5 #ifndef CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_
6 #define CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ 6 #define CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #pragma pack(push) 45 #pragma pack(push)
46 #pragma pack(4) 46 #pragma pack(4)
47 struct BufferData { 47 struct BufferData {
48 uint32 total_written; 48 uint32 total_written;
49 uint32 wrap_position; 49 uint32 wrap_position;
50 uint32 end_position; 50 uint32 end_position;
51 uint8 data[1]; 51 uint8 data[1];
52 }; 52 };
53 #pragma pack(pop) 53 #pragma pack(pop)
54 54
55 void DoWrite(void* dest, const void* src, uint32 num); 55 uint32 DoWrite(const uint8* input, uint32 input_size);
Nico 2015/04/08 23:13:05 Document what this returns, mention that it can re
gzobqq 2015/04/09 08:36:40 I changed DoWrite() to handle the complete input i
56 56
57 // Used for reading and writing. 57 // Used for reading and writing.
58 BufferData* buffer_data_; 58 BufferData* buffer_data_;
59 uint32 memory_buffer_size_; 59 uint32 memory_buffer_size_;
60 uint32 data_size_; 60 uint32 data_size_;
61 uint32 position_; 61 uint32 position_;
62 62
63 // Used for reading. 63 // Used for reading.
64 uint32 total_read_; 64 uint32 total_read_;
65 }; 65 };
66 66
67 #endif // CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ 67 #endif // CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/common/partial_circular_buffer.cc » ('j') | chrome/common/partial_circular_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698