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

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

Original Pull Request: https://github.com/microsoft/terminal/pull/10544

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/10544 **State:** closed **Merged:** Yes --- ## 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.
claunia added the pull-request label 2026-01-31 09:26:21 +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#28102