Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle invalid UTF-8 in filenames #34

Closed
sharkdp opened this issue Jun 7, 2017 · 0 comments
Closed

Properly handle invalid UTF-8 in filenames #34

sharkdp opened this issue Jun 7, 2017 · 0 comments
Labels

Comments

@sharkdp
Copy link
Owner

sharkdp commented Jun 7, 2017

In particular, OsStr to String conversions may fail.

Quote by @BurntSushi on reddit:

You are converting all paths to strings before searching, which will probably blow up on you in some cases when file paths don't contain valid UTF-8. (And it does happen, because I had a similar bug in my own code.) On *nix at least, you can extract the raw &[u8] from a file path safely and then feed that into a regex::bytes::Regex (instead of regex::Regex).

@sharkdp sharkdp added the bug label Jun 7, 2017
sharkdp added a commit that referenced this issue Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant