-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Crash in ScrollConsoleScreenBuffer when destination coordinates overflow #5271
Comments
FYI, I've just tested with the first open source release (commit d4d59fa), and the bug was already present there. However, the legacy console doesn't have this issue. In some ways this is could be considered a part of issue #4153, but I thought it worth raising separately because of the crash, and the fact that it's not obviously "safe math" code. |
Regressed between RS5 (17763) and 19H1 (18362). Thanks! |
Off triage, P2, /cc @miniksa for a conhost regression from the scrolling change in 19H1 |
This removes one source of potential integer overflows from the Viewport class. Other parts were left untouched, as this entire class of overflow issues gets fixed all at once, as soon as we replace COORD with til::coord (etc.). ## PR Checklist * [x] Closes #5271 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Call `ScrollConsoleScreenBufferW` with out of bounds coordinates * Doesn't crash ✅
This removes one source of potential integer overflows from the Viewport class. Other parts were left untouched, as this entire class of overflow issues gets fixed all at once, as soon as we replace COORD with til::coord (etc.). * [x] Closes #5271 * [x] I work here * [x] Tests added/passed * Call `ScrollConsoleScreenBufferW` with out of bounds coordinates * Doesn't crash ✅ (cherry picked from commit a4a6dfc)
This removes one source of potential integer overflows from the Viewport class. Other parts were left untouched, as this entire class of overflow issues gets fixed all at once, as soon as we replace COORD with til::coord (etc.). ## PR Checklist * [x] Closes #5271 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Call `ScrollConsoleScreenBufferW` with out of bounds coordinates * Doesn't crash ✅ (cherry picked from commit a4a6dfc) Signed-off-by: Dustin Howett <[email protected]>
This removes one source of potential integer overflows from the Viewport class. Other parts were left untouched, as this entire class of overflow issues gets fixed all at once, as soon as we replace COORD with til::coord (etc.). ## PR Checklist * [x] Closes #5271 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Call `ScrollConsoleScreenBufferW` with out of bounds coordinates * Doesn't crash ✅ (cherry picked from commit a4a6dfc)
🎉This issue was addressed in #12669, which has now been successfully released as Handy links: |
🎉This issue was addressed in #12669, which has now been successfully released as Handy links: |
Environment
Windows build number: Version 10.0.18362.657
Steps to reproduce
Compile and run the following C++ code in a conhost cmd shell:
Expected behavior
The first 40 characters of the first line should fill with X's.
Actual behavior
The console crashes.
When the
ScrollRegion
function is copying the area that is being scrolled, the_CopyRectangle
function makes use of theViewport::WalkInBoundsCircular
method, and that fails when the target position goes out of bounds. See here:terminal/src/types/viewport.cpp
Line 411 in 5de9fa9
The text was updated successfully, but these errors were encountered: