| Summary: | AX: -[WebAccessibilityObjectWrapper attributedStringForNSRange:] should exit early for ranges of zero length | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Tyler Wilcock <tyler_w> | ||||||
| Component: | Accessibility | Assignee: | Tyler Wilcock <tyler_w> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | Other | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Tyler Wilcock
2023-08-10 20:50:40 PDT
Created attachment 467243 [details]
Patch
(In reply to Tyler Wilcock from comment #3) > Created attachment 467243 [details] > Patch --- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm +++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm + auto attributedString = backingObject->attributedStringForTextMarkerRange(backingObject->textMarkerRangeForNSRange(range), AXCoreObject::SpellCheck::Yes); + if (![attributedString length]) + return nil; + + return attributedString.autorelease(); Looks good, just consider the 2 liner: auto attributedString = backingObject->attributedStringForTextMarkerRange(backingObject->textMarkerRangeForNSRange(range), AXCoreObject::SpellCheck::Yes); return [attributedString length] ? attributedString.autorelease() : nil; Created attachment 467318 [details]
Patch
Committed 267045@main (f4896f6e7c4b): <https://commits.webkit.org/267045@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 467318 [details]. |