[PR #10544] [MERGED] [A11y] Initialize and copy _blockRange in UIA Clone #28097

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10544
Author: @carlos-zamora
Created: 7/2/2021
Status: Merged
Merged: 7/6/2021
Merged by: @undefined

Base: mainHead: dev/cazamor/a11y/bugfix-word-boundary


📝 Commits (2)

  • 45811df [A11y] Initialize and copy _blockRange in UIA Clone
  • 899de80 apply PR feedback

📊 Changes

3 files changed (+25 additions, -1 deletions)

View changed files

📝 src/interactivity/win32/ut_interactivity_win32/UiaTextRangeTests.cpp (+23 -0)
📝 src/types/UiaTextRangeBase.cpp (+1 -0)
📝 src/types/UiaTextRangeBase.hpp (+1 -1)

📄 Description

Summary of the Pull Request

#7960 was caused by UiaTextRangeBase::_blockRange not being initialized, thus pointing to random memory. In most cases, we initialize it properly in RuntimeClassInitialize, however, the copying version of RuntimeClassInitialize doesn't actually copy it over, resulting in it still containing random memory.

NVDA (and other screen readers) occasionally use Clone (really just the copy initializer), resulting in this bug occurring randomly.

PR Checklist

Validation Steps Performed

Test failed before the change, but passes after the change.


🔄 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/10544 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 7/2/2021 **Status:** ✅ Merged **Merged:** 7/6/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/a11y/bugfix-word-boundary` --- ### 📝 Commits (2) - [`45811df`](https://github.com/microsoft/terminal/commit/45811dfd523d9e7933b6044679dc2d4dae0fd47d) [A11y] Initialize and copy _blockRange in UIA Clone - [`899de80`](https://github.com/microsoft/terminal/commit/899de80412c19f7cefd24c9699cabc54753ee7ba) apply PR feedback ### 📊 Changes **3 files changed** (+25 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/interactivity/win32/ut_interactivity_win32/UiaTextRangeTests.cpp` (+23 -0) 📝 `src/types/UiaTextRangeBase.cpp` (+1 -0) 📝 `src/types/UiaTextRangeBase.hpp` (+1 -1) </details> ### 📄 Description ## Summary of the Pull Request #7960 was caused by `UiaTextRangeBase::_blockRange` not being initialized, thus pointing to random memory. In most cases, we initialize it properly in `RuntimeClassInitialize`, however, the copying version of `RuntimeClassInitialize` doesn't actually copy it over, resulting in it still containing random memory. NVDA (and other screen readers) occasionally use `Clone` (really just the copy initializer), resulting in this bug occurring randomly. ## PR Checklist * [X] Closes #7960 * [X] Tests added/passed ## Validation Steps Performed Test failed before the change, but passes after the change. --- <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:26: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#28097