about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
authorDan Gohman <dev@sunfishcode.online>2023-02-23 04:56:31 -0800
committerDan Gohman <dev@sunfishcode.online>2023-02-23 06:29:11 -0800
commitc0c1925774bc07a25bd6a3f07f75abf274183cfb (patch)
tree08b7892b64435b01e26b735a2475a243b6d7f77a /compiler/rustc_query_impl/src
parent07c993eba8b76eae497e98433ae075b00f01be10 (diff)
downloadrust-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