Skip to content

Conversation

@marinofelipe
Copy link
Contributor

Hello there 👋.

We at GetYourGuide are using the Adjust iOS SDK.

We've been experiencing a crash, and we found that it can happen when handling a "malformed" URL.

The crash occurs in ADJActivityHandler, when it fails to decode a query string parameter value.
The nil decodedValue then gets added to the adjustDeepLinks dictionary, with
[adjustDeepLinks setObject:valueDecoded forKey:keyWOutPrefix];. This causes a crash.

Crash message example:

Fatal Exception: NSInvalidArgumentException
*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: deeplink)
-[ADJActivityHandler readDeeplinkQueryStringI:queryString:adjustDeepLinks:attribution:]

We added validation to prevent this from happening, returning NO if valueDecoded is nil.

It is worth mentioning that the valueDecoded NSString pointer can be a nil value as adjUrlDecode uses the native function CFURLCreateStringByReplacingPercentEscapes which can return NULL if it fails to convert the percent escapes to characters.

A new CFString object, or NULL if the percent escapes cannot be converted to characters, assuming UTF-8 encoding.

We hope that this can help prevent crashes when, for example, an NSURL has percent escapes using UTF-16 encoding.

@uerceg
Copy link
Contributor

uerceg commented Mar 12, 2020

Hi @marinofelipe

And sorry for a bit delayed reply on this one. Thanks for the PR! We'll add it to our next iOS SDK update. Will keep you posted in here.

Cheers

@marinofelipe
Copy link
Contributor Author

Hi @uerceg,

No problem at all. That's nice, thanks for letting me know. Cheers!

@uerceg
Copy link
Contributor

uerceg commented Mar 19, 2020

Replaced by #414.

Thank you one more time! 🍺

@uerceg uerceg closed this Mar 19, 2020
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.

2 participants