Closed lf- closed 3 years ago
Previously, unchecked user input bytes were passed into str::from_utf8_unchecked, which was unsound as it was within a safe function. It's been revised to check the user input and fail if there's invalid input.
str::from_utf8_unchecked
For a file with fun contents of broken UTF-8 to test with, see https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
Thanks! Must of missed it when reviewing other's prs
Previously, unchecked user input bytes were passed into
str::from_utf8_unchecked
, which was unsound as it was within a safe function. It's been revised to check the user input and fail if there's invalid input.For a file with fun contents of broken UTF-8 to test with, see https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt