Skip to content

Conversation

LumingYin
Copy link

@LumingYin LumingYin commented Apr 13, 2023

e57c456

Fix over-release in ClientConnection::hostAppCodeSigningIdentifier
https://bugs.webkit.org/show_bug.cgi?id=255384
rdar://107974725

Reviewed by Simon Fraser.

In rdar://107931346, we introduced a change that wraps the value returned by CFArrayGetValueAtIndex()
using adoptCF. However, since CFArrayGetValueAtIndex() doesn’t return a retained object, our code will
cause an over-release. To resolve this issue, do not wrap the value returned by CFArrayGetValueAtIndex()
using adoptCF.

Additionally, the keys and values array were incorrectly swapped, causing the returned bundleIdentifier
to be loginwindow instead of the belonging app. Fix this by swapping keys and values so they are in the
correct order.

* Source/WebKit/webpushd/PushClientConnection.mm:
(WebPushD::ClientConnection::bundleIdentifierFromAuditToken):
Swap keys and values so they are in the correct order, and do not wrap the value returned by
CFArrayGetValueAtIndex().

Canonical link: https://commits.webkit.org/262922@main

72981a3

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2
✅ 🛠 tv-sim ✅ 🧪 mac-wk2-stress
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@LumingYin LumingYin force-pushed the eng/Fix-over-release-in-ClientConnectionhostAppCodeSigningIdentifier branch from 3ea07be to 72981a3 Compare April 13, 2023 04:12
@beidson beidson added the merge-queue Applied to send a pull request to merge-queue label Apr 13, 2023
https://bugs.webkit.org/show_bug.cgi?id=255384
rdar://107974725

Reviewed by Simon Fraser.

In rdar://107931346, we introduced a change that wraps the value returned by CFArrayGetValueAtIndex()
using adoptCF. However, since CFArrayGetValueAtIndex() doesn’t return a retained object, our code will
cause an over-release. To resolve this issue, do not wrap the value returned by CFArrayGetValueAtIndex()
using adoptCF.

Additionally, the keys and values array were incorrectly swapped, causing the returned bundleIdentifier
to be loginwindow instead of the belonging app. Fix this by swapping keys and values so they are in the
correct order.

* Source/WebKit/webpushd/PushClientConnection.mm:
(WebPushD::ClientConnection::bundleIdentifierFromAuditToken):
Swap keys and values so they are in the correct order, and do not wrap the value returned by
CFArrayGetValueAtIndex().

Canonical link: https://commits.webkit.org/262922@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Fix-over-release-in-ClientConnectionhostAppCodeSigningIdentifier branch from 72981a3 to e57c456 Compare April 13, 2023 18:26
@webkit-commit-queue
Copy link
Collaborator

Committed 262922@main (e57c456): https://commits.webkit.org/262922@main

Reviewed commits have been landed. Closing PR #12686 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit e57c456 into WebKit:main Apr 13, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants