diff options
| author | Dan Gohman <dev@sunfishcode.online> | 2023-02-23 04:56:31 -0800 |
|---|---|---|
| committer | Dan Gohman <dev@sunfishcode.online> | 2023-02-23 06:29:11 -0800 |
| commit | c0c1925774bc07a25bd6a3f07f75abf274183cfb (patch) | |
| tree | 08b7892b64435b01e26b735a2475a243b6d7f77a /compiler/rustc_query_impl/src | |
| parent | 07c993eba8b76eae497e98433ae075b00f01be10 (diff) | |
| download | rust-c0c1925774bc07a25bd6a3f07f75abf274183cfb.tar.gz rust-c0c1925774bc07a25bd6a3f07f75abf274183cfb.zip | |
Fix `is_terminal`'s handling of long paths on Windows.
As reported in sunfishcode/is-terminal#18, there are situations where `GetFileInformationByHandleEx` can write a file name length that is longer than the provided buffer. To avoid deferencing memory past the end of the buffer, use a bounds-checked function to form a slice to the buffer and handle the out-of-bounds case. This ports the fix from sunfishcode/is-terminal#19 to std's `is_terminal` implementation.
Diffstat (limited to 'compiler/rustc_query_impl/src')
0 files changed, 0 insertions, 0 deletions
