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
Review URL: https://codereview.chromium.org/1836923002
Cr-Commit-Position: refs/heads/master@{#384343}
CrOS-Libchrome-Original-Commit: 03478a11686beb7e5aaed214d2791ef917b6b8aa
2 files changed