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
tree: a5fb709c6af1a1dceece18e37d111192228b8dc2
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/