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

Issue 1836923002: Handle invalid CFStrings in GetHFSDecomposedForm() (Closed)

Created:
4 years, 8 months ago by Jialiu Lin
Modified:
4 years, 8 months ago
Reviewers:
Robert Sesek, Lei Zhang
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Handle invalid CFStrings in GetHFSDecomposedForm(). Error (caused by invalid UTF-8 sequence) might occur during the creation of CFString (i.e.CFStringCreateWithBytesNoCopy(...)), which leads to crash in CFStringGetMaximumSizeOfFileSystemRepresentation(..) function. This CL checks if the creation of CFString is successful before calling CFStringGetMaximumSizeOfFileSystemRepresentation to prevent crash. A unit test is added to verify invalid sequences are handled correctly. BUG=558847 Committed: https://crrev.com/03478a11686beb7e5aaed214d2791ef917b6b8aa Cr-Commit-Position: refs/heads/master@{#384343}

Patch Set 1 #

Patch Set 2 : add unit test #

Patch Set 3 : nit #

Patch Set 4 : nit #

Total comments: 4

Patch Set 5 : fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -20 lines) Patch
M base/files/file_path.cc View 2 chunks +22 lines, -20 lines 0 comments Download
M base/files/file_path_unittest.cc View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (10 generated)
Jialiu Lin
Hi Robert, This is my best guess of what causes the crash in base::FilePath::GetHFSDecomposedForm. Let ...
4 years, 8 months ago (2016-03-28 18:22:45 UTC) #3
Robert Sesek
I think your analysis is correct, so yes this makes sense. Could you write a ...
4 years, 8 months ago (2016-03-28 18:41:48 UTC) #4
Jialiu Lin
On 2016/03/28 at 18:41:48, rsesek wrote: > I think your analysis is correct, so yes ...
4 years, 8 months ago (2016-03-30 01:09:12 UTC) #6
Jialiu Lin
+thestig@, could you take a look at this CL that aims for solving the following ...
4 years, 8 months ago (2016-03-30 17:40:30 UTC) #10
Robert Sesek
LGTM
4 years, 8 months ago (2016-03-30 21:03:26 UTC) #11
Lei Zhang
lgtm https://codereview.chromium.org/1836923002/diff/50003/base/files/file_path_unittest.cc File base/files/file_path_unittest.cc (right): https://codereview.chromium.org/1836923002/diff/50003/base/files/file_path_unittest.cc#newcode1302 base/files/file_path_unittest.cc:1302: const struct UnaryBooleanTestData cases[] = { You are ...
4 years, 8 months ago (2016-03-30 21:53:08 UTC) #12
Lei Zhang
I'd also suggest a more git friendly commit message. e.g. Handle invalid CFStrings in GetHFSDecomposedForm() ...
4 years, 8 months ago (2016-03-30 21:59:57 UTC) #13
Jialiu Lin
Thanks, thestig@! your comments are all addressed. https://codereview.chromium.org/1836923002/diff/50003/base/files/file_path_unittest.cc File base/files/file_path_unittest.cc (right): https://codereview.chromium.org/1836923002/diff/50003/base/files/file_path_unittest.cc#newcode1302 base/files/file_path_unittest.cc:1302: const struct ...
4 years, 8 months ago (2016-03-31 00:44:51 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1836923002/70001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1836923002/70001
4 years, 8 months ago (2016-03-31 18:32:18 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:70001)
4 years, 8 months ago (2016-03-31 18:38:56 UTC) #19
commit-bot: I haz the power
4 years, 8 months ago (2016-03-31 18:45:12 UTC) #21
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/03478a11686beb7e5aaed214d2791ef917b6b8aa
Cr-Commit-Position: refs/heads/master@{#384343}

Powered by Google App Engine
This is Rietveld 408576698