Skip to content

Safely inspect bundles for classes #1090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2017
Merged

Conversation

flovilmart
Copy link
Contributor

Fixes #1006

Makes sure we don't check classes in not loaded bundles.

@flovilmart
Copy link
Contributor Author

@hramos @nlutsenko, we are kinda stuck here with that one. Could you review, advise?

@hramos hramos merged commit f6f4d32 into parse-community:master Feb 7, 2017
@flovilmart
Copy link
Contributor Author

Thanks @hramos !

@flovilmart flovilmart deleted the fix-1006 branch February 7, 2017 20:53
@flovilmart flovilmart restored the fix-1006 branch February 7, 2017 20:53
@flovilmart
Copy link
Contributor Author

@hramos I'll need the commit access to the repo as Cocoapods require the tag to be pushed before
I can send pod to trunk. Opening #1111

@hramos
Copy link
Contributor

hramos commented Feb 19, 2017

@flovilmart invited

@flovilmart
Copy link
Contributor Author

flovilmart commented Feb 19, 2017

Turns out I don't have access to the pods either ;/

!] You ([email protected]) are not allowed to push new versions for this pod. The owners of this pod are [email protected], [email protected], [email protected], and [email protected].

@levigroker
Copy link
Contributor

Anyone have pod access to push out 1.14.3? Please?

@levigroker
Copy link
Contributor

@flovilmart We manually put this change in our now-production app and are seeing a crash (unknown selector sent to instance). Specifically, it appears that _registerSubclassesInLoadedBundle: can be called with objects (NSString apparently) which are not NSBundle objects, and the loaded message is sent to an object which doesn't handle the selector. I'd guess this is coming from the NSBundleDidLoadNotification note.object but haven't verified that.

An obvious armor for this is to ensure the object is of the intended type in _registerSubclassesInLoadedBundle.

i.e. Change:

if (!bundle.loaded || !bundle.executablePath) {

to

if (![bundle isKindOfClass:NSBundle.class] || !bundle.loaded || !bundle.executablePath) {

(though it would be nice to understand why we're not getting NSBundle objects, this will prevent the crash).

Since 1.14.3 has yet to be released, this change (or similar) prior to release would be appreciated.

Cheers,

Levi

@flovilmart
Copy link
Contributor Author

The changes have been merged to master, can you open a Pr with your suggestion and the fix?

@levigroker levigroker mentioned this pull request Mar 8, 2017
@levigroker
Copy link
Contributor

@flovilmart Cheers. Here's the pull: #1119

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.

4 participants