Bug 225312 - Transfer ownership to ARC in speechSynthesisGetDefaultVoiceIdentifierForLocale
Summary: Transfer ownership to ARC in speechSynthesisGetDefaultVoiceIdentifierForLocale
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-03 09:40 PDT by Sihui Liu
Modified: 2021-05-03 13:25 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.70 KB, patch)
2021-05-03 09:43 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
[fast-cq] Patch (1.63 KB, patch)
2021-05-03 13:20 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2021-05-03 09:40:47 PDT
...
Comment 1 Radar WebKit Bug Importer 2021-05-03 09:40:56 PDT
<rdar://problem/77458746>
Comment 2 Sihui Liu 2021-05-03 09:43:52 PDT
Created attachment 427569 [details]
Patch
Comment 3 EWS 2021-05-03 11:51:13 PDT
Committed r276913 (237257@main): <https://commits.webkit.org/237257@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427569 [details].
Comment 4 Darin Adler 2021-05-03 12:20:26 PDT
Comment on attachment 427569 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427569&action=review

> Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm:230
> +    return adoptCF(GetIdentifierStringForPreferredVoiceInListWithLocale(speechSynthesisGetVoiceIdentifiers().get(), (__bridge CFLocaleRef)userLocale)).bridgingAutorelease();

This looks wrong and looks like an overrelease which could introduce a security bug. A function named GetIdentifierStringForPreferredVoiceInListWithLocale will *not* return a retained CFStringRef that should be released or adopted.

There’s something deeper going on here. If there’s a memory leak, then the is not the correct fix for that cause.
Comment 5 Sihui Liu 2021-05-03 13:20:48 PDT
Reopening to attach new patch.
Comment 6 Sihui Liu 2021-05-03 13:20:49 PDT
Created attachment 427591 [details]
[fast-cq] Patch
Comment 7 EWS 2021-05-03 13:23:07 PDT
Committed r276921 (237263@main): <https://commits.webkit.org/237263@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427591 [details].
Comment 8 Sihui Liu 2021-05-03 13:25:06 PDT
Revert the change as GetIdentifierStringForPreferredVoiceInListWithLocale does not actually returns a copy like Darin said, so it's not on us to release it.