[PR #12669] [MERGED] Fix overflow in Viewport::FromDimensions #29170

Open
opened 2026-01-31 09:33:15 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12669
Author: @lhecker
Created: 3/11/2022
Status: Merged
Merged: 3/11/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/5271-viewport-overflow


📝 Commits (1)

  • 92a1e7d Fix overflow in Viewport::FromDimensions

📊 Changes

2 files changed (+13 additions, -4 deletions)

View changed files

📝 src/renderer/base/renderer.cpp (+1 -2)
📝 src/types/viewport.cpp (+12 -2)

📄 Description

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

Validation Steps Performed

  • Call ScrollConsoleScreenBufferW with out of bounds coordinates
  • Doesn't crash

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/12669 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 3/11/2022 **Status:** ✅ Merged **Merged:** 3/11/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/5271-viewport-overflow` --- ### 📝 Commits (1) - [`92a1e7d`](https://github.com/microsoft/terminal/commit/92a1e7d81b29101a850f45f43311074ad4b50d0c) Fix overflow in Viewport::FromDimensions ### 📊 Changes **2 files changed** (+13 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/base/renderer.cpp` (+1 -2) 📝 `src/types/viewport.cpp` (+12 -2) </details> ### 📄 Description 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 ✅ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:33:15 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29170