Make FileUitls::Canonicalize return the empty string if it encounters a path with a null byte
Summary:In
D1837683 the behavior of `File::Open` changed so that we would return null if the provided path contained null. This change was correct as a defense-in-depth technique but it doesn't go far enough: there are a number of places which call `File::TranslatePath` before calling `File::Open`, which leads to the null byte being normalized out.
My change here is to make the code return the empty string from `File::TranslatePath` if we encounter a null-byte. I do that by making `FileUitls::Canonicalize` handle null bytes by returning an empty string. This doesn't directly address functions with null-byte issues, but it may prevent some of them.
Reviewed By: markw65
Differential Revision:
D2456626
fb-gh-sync-id:
c01275a67c2ef5711a07772f10297af60bcd9548
shipit-source-id:
c01275a67c2ef5711a07772f10297af60bcd9548