Skip to content

Conversation

@absaroj
Copy link
Contributor

@absaroj absaroj commented Mar 17, 2023

In some rare cases, when UTF8String fails the conversions from NSString (due to low memory), it returns NULL, which if passed to std::string(), results in undefined behavior.

Adding null check before the std::string and if null then using "und" as unknown language code (as per iso 639).

Copy link
Contributor

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

@absaroj absaroj merged commit a4f9b00 into main Mar 21, 2023
@absaroj absaroj deleted the absaroj/fix_crash_for_mau branch March 21, 2023 22:33
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.

3 participants