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

Fix "Out of bounds" crash on iOS #409

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

tomekzaw
Copy link
Collaborator

@tomekzaw tomekzaw commented Jul 2, 2024

Details

This PR fixes the following crash on iOS

NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds

when returning improper ranges, in particular:

  1. when passing a range with zero length, e.g. { start: 10, length: 0, type: 'code' }

Screenshot 2024-07-02 at 10 18 43

  1. when passing a range that is longer than the string itself, e.g. { start: 0, length: 9999, type: 'bold' }
Screenshot 2024-07-02 at 10 19 26

Related Issues

GH_LINK

Manual Tests

Linked PRs

@tomekzaw tomekzaw requested a review from BartoszGrajdek July 2, 2024 08:31
Copy link
Collaborator

@Skalakid Skalakid left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@BartoszGrajdek BartoszGrajdek left a comment

Choose a reason for hiding this comment

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

LGTM!

@tomekzaw tomekzaw merged commit c4ed439 into main Jul 2, 2024
5 checks passed
@tomekzaw tomekzaw deleted the @tomekzaw/fix-ios-crash-out-of-bounds branch July 2, 2024 09:18
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