Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UIA: Prevent crash from invalid UTR endpoint comparison (#5399)
## Summary of the Pull Request This is a quick-and-easy solution to #5309. If the ITextRangeProvider API allows us to take in two UiaTextRanges, we need to verify that they are both valid. With this PR, we make sure they both fit in the current TextBuffer. If not, we return `E_FAIL`. Though this doesn't prove that both UiaTextRanges are from the same TextBuffer, at the very least we don't crash and in cases where we can't make a valid comparison, we return an HRESULT failure. ## References #5406 - This should be the proper solution to this problem. Each UiaTextRange needs to be aware of which TextBuffer it came from. ## PR Checklist * [X] Closes #5309 ## Validation Steps Performed 1. generate enough output to cause the terminal to scroll 2. execute `nano` to make us go into the alternate buffer This previously crashed, now NVDA seems to detect that there was an error and keeps moving along.
- Loading branch information