[PR #14275] [MERGED] AtlasEngine: Fix a heap overflow bug #30037

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14275
Author: @lhecker
Created: 10/21/2022
Status: Merged
Merged: 11/2/2022
Merged by: @lhecker

Base: mainHead: dev/lhecker/atlas-engine-heap-overflow


📝 Commits (3)

  • d794069 AtlasEngine: Fix a heap overflow bug
  • 35c8029 Revert an unnecessary change
  • 0982f68 Merge remote-tracking branch 'origin/main' into dev/lhecker/atlas-engine-heap-overflow

📊 Changes

2 files changed (+59 additions, -27 deletions)

View changed files

📝 src/renderer/atlas/AtlasEngine.api.cpp (+24 -19)
📝 src/renderer/atlas/AtlasEngine.cpp (+35 -8)

📄 Description

TextBuffer is buggy and allows a Trailing DbcsAttribute to be written
into the first column. Since other code then blindly assumes that there's a
preceding Leading character, we'll get called with a X coordinate of -1.
This issue will be fixed by #13626 and this commit fixes it in the meantime.

Additionally fixes an unimportant crash when the window height is 0px,
because it was annoying during testing and doesn't hurt to be fixed.

Validation Steps Performed

  • Run a stress test that prints random Unicode at random positions
  • Resize the window furiously at the same time
  • Doesn't crash / fail-fast

🔄 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/14275 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 10/21/2022 **Status:** ✅ Merged **Merged:** 11/2/2022 **Merged by:** [@lhecker](https://github.com/lhecker) **Base:** `main` ← **Head:** `dev/lhecker/atlas-engine-heap-overflow` --- ### 📝 Commits (3) - [`d794069`](https://github.com/microsoft/terminal/commit/d794069ec0a3f16d268844a2c9938b638e6ad761) AtlasEngine: Fix a heap overflow bug - [`35c8029`](https://github.com/microsoft/terminal/commit/35c8029f5949121c619a5eeaeed4f9a5169ef621) Revert an unnecessary change - [`0982f68`](https://github.com/microsoft/terminal/commit/0982f68e2884294bcf0e03962a68be118eca6aeb) Merge remote-tracking branch 'origin/main' into dev/lhecker/atlas-engine-heap-overflow ### 📊 Changes **2 files changed** (+59 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/atlas/AtlasEngine.api.cpp` (+24 -19) 📝 `src/renderer/atlas/AtlasEngine.cpp` (+35 -8) </details> ### 📄 Description `TextBuffer` is buggy and allows a `Trailing` `DbcsAttribute` to be written into the first column. Since other code then blindly assumes that there's a preceding `Leading` character, we'll get called with a X coordinate of -1. This issue will be fixed by #13626 and this commit fixes it in the meantime. Additionally fixes an unimportant crash when the window height is 0px, because it was annoying during testing and doesn't hurt to be fixed. ## Validation Steps Performed * Run a stress test that prints random Unicode at random positions * Resize the window furiously at the same time * Doesn't crash / fail-fast ✅ --- <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:38:18 +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#30037