Skip to content
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

Data deserialization crash in PTPusherEvent is fixed #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darvin
Copy link

@darvin darvin commented Sep 14, 2015

It could crash if string is empty

@lukeredpath lukeredpath modified the milestone: v1.6.2 Sep 29, 2015
@darvin
Copy link
Author

darvin commented Mar 17, 2016

Any luck in reviewing it?

@hamchapman
Copy link
Contributor

@lukeredpath is this good to be merged?

@@ -31,7 +31,8 @@ - (id)initWithEventName:(NSString *)name channel:(NSString *)channel data:(id)da
_timeReceived = [NSDate date];

// try and deserialize the data as JSON if possible
if ([data respondsToSelector:@selector(dataUsingEncoding:)]) {
if ([data respondsToSelector:@selector(dataUsingEncoding:)] &&
!([data isKindOfClass:[NSString class]] && [data isEqualToString:@""]) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this just check isEqual and skip the class check for NSString?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants