Skip to content

Data deserialization crash in PTPusherEvent is fixed#186

Open
darvin wants to merge 1 commit into
pusher:masterfrom
alignd:features/data_deserialization_crash
Open

Data deserialization crash in PTPusherEvent is fixed#186
darvin wants to merge 1 commit into
pusher:masterfrom
alignd:features/data_deserialization_crash

Conversation

@darvin

@darvin darvin commented Sep 14, 2015

Copy link
Copy Markdown

It could crash if string is empty

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

darvin commented Mar 17, 2016

Copy link
Copy Markdown
Author

Any luck in reviewing it?

@hamchapman

Copy link
Copy Markdown
Contributor

@lukeredpath is this good to be merged?

Comment thread Library/PTPusherEvent.m
// 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
Copy Markdown
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.

5 participants