Fix is_terminal's handling of long paths on Windows.#108391
Fix is_terminal's handling of long paths on Windows.#108391bors merged 1 commit intorust-lang:masterfrom
is_terminal's handling of long paths on Windows.#108391Conversation
|
r? @ChrisDenton (rustbot has picked a reviewer for you, use r? to override) |
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
This comment has been minimized.
This comment has been minimized.
ChrisDenton
left a comment
There was a problem hiding this comment.
This looks good to me. I only have a very minor doc comment nit. Also if you could squish the commits into one then I'll ask bors to merge.
a7a395a to
46eddd4
Compare
|
I've now sqashed the commits into one. |
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.
46eddd4 to
c0c1925
Compare
|
@bors r+ rollup |
chore: bump is-terminal to 0.4.4 Fixes #11710. See sunfishcode/is-terminal#18 See also rust-lang/rust#108391
…l-file-length, r=ChrisDenton 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.
Rollup of 10 pull requests Successful merges: - rust-lang#106541 (implement const iterator using `rustc_do_not_const_check`) - rust-lang#106918 (Rebuild BinaryHeap on unwind from retain) - rust-lang#106923 (Restore behavior when primary bundle is missing) - rust-lang#108169 (Make query keys `Copy`) - rust-lang#108287 (Add test for bad cast with deferred projection equality) - rust-lang#108370 (std: time: Avoid to use "was created" in elapsed() description) - rust-lang#108377 (Fix ICE in 'duplicate diagnostic item' diagnostic) - rust-lang#108388 (parser: provide better suggestions and errors on closures with braces missing) - rust-lang#108391 (Fix `is_terminal`'s handling of long paths on Windows.) - rust-lang#108401 (diagnostics: remove inconsistent English article "this" from E0107) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
As reported in sunfishcode/is-terminal#18, there are situations where
GetFileInformationByHandleExcan 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_terminalimplementation.