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

Side by Side Diff: base/file_util_proxy.h

Issue 7651002: Adding checks to guard against buffer overruns in QuotaFileIO::Write and base::FileUtilProxy::Write (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/file_util_proxy.cc » ('j') | ppapi/c/ppb_file_io.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 BASE_FILE_UTIL_PROXY_H_ 5 #ifndef BASE_FILE_UTIL_PROXY_H_
6 #define BASE_FILE_UTIL_PROXY_H_ 6 #define BASE_FILE_UTIL_PROXY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 static bool Read( 161 static bool Read(
162 scoped_refptr<MessageLoopProxy> message_loop_proxy, 162 scoped_refptr<MessageLoopProxy> message_loop_proxy,
163 PlatformFile file, 163 PlatformFile file,
164 int64 offset, 164 int64 offset,
165 int bytes_to_read, 165 int bytes_to_read,
166 ReadCallback* callback); 166 ReadCallback* callback);
167 167
168 // Writes to a file. If |offset| is greater than the length of the file, 168 // Writes to a file. If |offset| is greater than the length of the file,
169 // |false| is returned. On success, the file pointer is moved to position 169 // |false| is returned. On success, the file pointer is moved to position
170 // |offset + bytes_to_write| in the file. The callback can be NULL. 170 // |offset + bytes_to_write| in the file. The callback can be NULL.
171 // |bytes_to_write| must be greater than zero.
171 static bool Write( 172 static bool Write(
172 scoped_refptr<MessageLoopProxy> message_loop_proxy, 173 scoped_refptr<MessageLoopProxy> message_loop_proxy,
173 PlatformFile file, 174 PlatformFile file,
174 int64 offset, 175 int64 offset,
175 const char* buffer, 176 const char* buffer,
176 int bytes_to_write, 177 int bytes_to_write,
177 WriteCallback* callback); 178 WriteCallback* callback);
178 179
179 // Touches a file. The callback can be NULL. 180 // Touches a file. The callback can be NULL.
180 static bool Touch( 181 static bool Touch(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 PlatformFile file, 217 PlatformFile file,
217 StatusCallback* callback); 218 StatusCallback* callback);
218 219
219 private: 220 private:
220 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); 221 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy);
221 }; 222 };
222 223
223 } // namespace base 224 } // namespace base
224 225
225 #endif // BASE_FILE_UTIL_PROXY_H_ 226 #endif // BASE_FILE_UTIL_PROXY_H_
OLDNEW
« no previous file with comments | « no previous file | base/file_util_proxy.cc » ('j') | ppapi/c/ppb_file_io.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698