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

Issue 11642041: Don't allow '\0' characters in FilePath. (Closed)

Created:
8 years ago by aedla
Modified:
7 years, 10 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

Don't allow '\0' characters in FilePath. BUG=169777 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=179141

Patch Set 1 #

Total comments: 6

Patch Set 2 : addressed comments, added check to ReadFromPickle #

Total comments: 2

Patch Set 3 : name changes: zero->nul #

Total comments: 3

Patch Set 4 : test NUL rejection #

Total comments: 3

Patch Set 5 : addressed comments, check that FPS() works #

Total comments: 1

Patch Set 6 : use WriteToPickle and ReadFromPickle in ParamTraits #

Total comments: 1

Patch Set 7 : camelCase to lowercase_with_underscores #

Patch Set 8 : missing FPL, fix for SavePackageTest #

Patch Set 9 : resize -> reserve in SavePackageTest #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -24 lines) Patch
M base/file_path.h View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M base/file_path.cc View 1 2 3 4 5 8 chunks +23 lines, -5 lines 0 comments Download
M base/file_path_unittest.cc View 1 2 3 4 5 6 7 2 chunks +37 lines, -0 lines 0 comments Download
M content/browser/download/save_package_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 1 comment Download
M ipc/ipc_message_utils.cc View 1 2 3 4 5 1 chunk +2 lines, -9 lines 0 comments Download
M ipc/ipc_message_utils_unittest.cc View 1 2 3 4 5 6 1 chunk +10 lines, -8 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
aedla
Tom, what do you think of this change to FilePath?
8 years ago (2012-12-20 11:28:56 UTC) #1
Tom Sepez
On 2012/12/20 11:28:56, aedla wrote: > Tom, what do you think of this change to ...
8 years ago (2012-12-20 18:22:10 UTC) #2
aedla
On 2012/12/20 18:22:10, Tom Sepez wrote: > On 2012/12/20 11:28:56, aedla wrote: > > Tom, ...
8 years ago (2012-12-20 18:41:57 UTC) #3
Tom Sepez
path_.erase() is really std::string::erase()? If so, I thought it was only the character at position ...
8 years ago (2012-12-20 18:46:10 UTC) #4
aedla
On 2012/12/20 18:46:10, Tom Sepez wrote: > path_.erase() is really std::string::erase()? If so, I thought ...
8 years ago (2012-12-20 19:03:56 UTC) #5
Tom Sepez
ah, nevermind, I assumed you were using the iterator form.
8 years ago (2012-12-20 19:05:34 UTC) #6
Tom Sepez
https://codereview.chromium.org/11642041/diff/1/base/file_path.cc File base/file_path.cc (right): https://codereview.chromium.org/11642041/diff/1/base/file_path.cc#newcode44 base/file_path.cc:44: Should be in namespace { below. https://codereview.chromium.org/11642041/diff/1/base/file_path.cc#newcode187 base/file_path.cc:187: // ...
8 years ago (2012-12-20 21:14:34 UTC) #7
Tom Sepez
https://codereview.chromium.org/11642041/diff/1/base/file_path.cc File base/file_path.cc (right): https://codereview.chromium.org/11642041/diff/1/base/file_path.cc#newcode617 base/file_path.cc:617: return false; On 2012/12/20 21:14:34, Tom Sepez wrote: > ...
8 years ago (2012-12-20 21:19:39 UTC) #8
aedla
On 2012/12/20 21:19:39, Tom Sepez wrote: > https://codereview.chromium.org/11642041/diff/1/base/file_path.cc > File base/file_path.cc (right): > > https://codereview.chromium.org/11642041/diff/1/base/file_path.cc#newcode617 ...
8 years ago (2012-12-21 10:15:50 UTC) #9
Tom Sepez
I think this is OK, but please get brett to sign off on it. https://codereview.chromium.org/11642041/diff/9001/base/file_path.cc ...
8 years ago (2012-12-21 18:25:24 UTC) #10
Chris Evans
An alternate approach is to validate across the IPC layer. I'm not sure which approach ...
7 years, 11 months ago (2013-01-02 20:39:57 UTC) #11
brettw
I think it's reasonable for the FilePath to do this since embedded nulls are a ...
7 years, 11 months ago (2013-01-02 21:58:16 UTC) #12
cevans
https://codereview.chromium.org/11642041/diff/13002/base/file_path.cc File base/file_path.cc (right): https://codereview.chromium.org/11642041/diff/13002/base/file_path.cc#newcode189 base/file_path.cc:189: path_.erase(nul_pos, StringType::npos); It should be very easy to add ...
7 years, 11 months ago (2013-01-03 05:58:10 UTC) #13
aedla
This should be good to commit?
7 years, 11 months ago (2013-01-07 08:38:36 UTC) #14
Chris Evans
https://codereview.chromium.org/11642041/diff/19001/base/file_path.cc File base/file_path.cc (right): https://codereview.chromium.org/11642041/diff/19001/base/file_path.cc#newcode189 base/file_path.cc:189: path_.erase(nul_pos, StringType::npos); I'm ok either way, but just a ...
7 years, 11 months ago (2013-01-08 09:41:00 UTC) #15
aedla
PTAL On 2013/01/08 09:41:00, Chris Evans wrote: > I'm ok either way, but just a ...
7 years, 11 months ago (2013-01-08 15:24:07 UTC) #16
Tom Sepez
I'm on the erase the NUL and continue side of the fence but I could ...
7 years, 11 months ago (2013-01-08 19:19:11 UTC) #17
Chris Evans
https://codereview.chromium.org/11642041/diff/26001/base/file_path.cc File base/file_path.cc (right): https://codereview.chromium.org/11642041/diff/26001/base/file_path.cc#newcode625 base/file_path.cc:625: return false; Cleanup: the logic in here is now ...
7 years, 11 months ago (2013-01-23 10:34:06 UTC) #18
Chris Evans
On 2013/01/23 10:34:06, Chris Evans wrote: > https://codereview.chromium.org/11642041/diff/26001/base/file_path.cc > File base/file_path.cc (right): > > https://codereview.chromium.org/11642041/diff/26001/base/file_path.cc#newcode625 ...
7 years, 11 months ago (2013-01-25 21:48:12 UTC) #19
Chris Evans
On 2013/01/25 21:48:12, Chris Evans wrote: > On 2013/01/23 10:34:06, Chris Evans wrote: > > ...
7 years, 11 months ago (2013-01-25 21:49:53 UTC) #20
Tom Sepez
I can give you an LGTM for ipc/
7 years, 11 months ago (2013-01-25 21:51:22 UTC) #21
brettw
lgtm https://codereview.chromium.org/11642041/diff/33001/ipc/ipc_message_utils_unittest.cc File ipc/ipc_message_utils_unittest.cc (right): https://codereview.chromium.org/11642041/diff/33001/ipc/ipc_message_utils_unittest.cc#newcode67 ipc/ipc_message_utils_unittest.cc:67: FilePath okPath; Style nit: no camelCase, use lowercase_with_underscores. ...
7 years, 11 months ago (2013-01-25 22:06:03 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aedla@chromium.org/11642041/42001
7 years, 10 months ago (2013-01-28 09:36:55 UTC) #23
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) content_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=12194
7 years, 10 months ago (2013-01-28 10:12:09 UTC) #24
aedla
https://codereview.chromium.org/11642041/diff/48003/content/browser/download/save_package_unittest.cc File content/browser/download/save_package_unittest.cc (left): https://codereview.chromium.org/11642041/diff/48003/content/browser/download/save_package_unittest.cc#oldcode112 content/browser/download/save_package_unittest.cc:112: long_file_name.resize(kMaxFilePathLength + long_file_name.length()); Looks like reserve was intended here. ...
7 years, 10 months ago (2013-01-28 11:40:15 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aedla@chromium.org/11642041/48003
7 years, 10 months ago (2013-01-28 11:41:32 UTC) #26
commit-bot: I haz the power
7 years, 10 months ago (2013-01-28 13:47:57 UTC) #27
Message was sent while issue was closed.
Change committed as 179141

Powered by Google App Engine
This is Rietveld 408576698