Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

macOS: Fix crash in attributedSubstringForProposedRange with out of bounds range#54469

Merged
knopp merged 1 commit into
flutter-team-archive:mainfrom
knopp:attributed_substring_out_of_range
Aug 12, 2024
Merged

macOS: Fix crash in attributedSubstringForProposedRange with out of bounds range#54469
knopp merged 1 commit into
flutter-team-archive:mainfrom
knopp:attributed_substring_out_of_range

Conversation

@knopp

@knopp knopp commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

Fixes flutter/flutter#153157

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@knopp knopp changed the title macOS: Fix crash with out of boudns attributedSubstringForProposedRange macOS: Fix crash with out of bounds in attributedSubstringForProposedRange Aug 9, 2024
@knopp knopp changed the title macOS: Fix crash with out of bounds in attributedSubstringForProposedRange macOS: Fix crash in attributedSubstringForProposedRange with out of bounds range Aug 9, 2024
@knopp knopp requested a review from cbracken August 10, 2024 15:25

@cbracken cbracken left a comment

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.

Thanks for fixing! I remember adding a ton of mitigations for this sort of things when I wrote the original UITextInput implementation on iOS. I haven't read the equivalent protocol docs for macOS but I imagine that similar to UIKit, AppKit APIs reserve the right to pass you out-of-bounds values that we may not be protecting against :/

LGTM stamp from a Japanese personal seal

@jonahwilliams

Copy link
Copy Markdown
Contributor

Can we submit this?

@knopp knopp merged commit 5d8ee52 into flutter-team-archive:main Aug 12, 2024
@knopp knopp deleted the attributed_substring_out_of_range branch August 12, 2024 18:00
@knopp knopp restored the attributed_substring_out_of_range branch August 12, 2024 18:00
@knopp knopp deleted the attributed_substring_out_of_range branch August 12, 2024 18:00
@jonahwilliams

Copy link
Copy Markdown
Contributor

Thanks!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 12, 2024
auto-submit Bot pushed a commit to flutter/flutter that referenced this pull request Aug 12, 2024
flutter-team-archive/engine@bcf2dcc...5d8ee52

2024-08-12 matej.knopp@gmail.com macOS: Fix crash in attributedSubstringForProposedRange with out of bounds range (flutter-team-archive/engine#54469)
2024-08-12 737941+loic-sharma@users.noreply.github.com [Windows] Improve texture format logic (flutter-team-archive/engine#54329)
2024-08-12 bdero@google.com Revert "[Impeller] remove scene3d support." (flutter-team-archive/engine#54502)
2024-08-12 skia-flutter-autoroll@skia.org Roll Skia from f77adcef7c1c to ec7558d41b34 (1 revision) (flutter-team-archive/engine#54507)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jsimmons@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
DBowen33 pushed a commit to DBowen33/flutter that referenced this pull request Aug 16, 2024
…3313)

flutter-team-archive/engine@bcf2dcc...5d8ee52

2024-08-12 matej.knopp@gmail.com macOS: Fix crash in attributedSubstringForProposedRange with out of bounds range (flutter-team-archive/engine#54469)
2024-08-12 737941+loic-sharma@users.noreply.github.com [Windows] Improve texture format logic (flutter-team-archive/engine#54329)
2024-08-12 bdero@google.com Revert "[Impeller] remove scene3d support." (flutter-team-archive/engine#54502)
2024-08-12 skia-flutter-autoroll@skia.org Roll Skia from f77adcef7c1c to ec7558d41b34 (1 revision) (flutter-team-archive/engine#54507)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jsimmons@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…3313)

flutter-team-archive/engine@bcf2dcc...5d8ee52

2024-08-12 matej.knopp@gmail.com macOS: Fix crash in attributedSubstringForProposedRange with out of bounds range (flutter-team-archive/engine#54469)
2024-08-12 737941+loic-sharma@users.noreply.github.com [Windows] Improve texture format logic (flutter-team-archive/engine#54329)
2024-08-12 bdero@google.com Revert "[Impeller] remove scene3d support." (flutter-team-archive/engine#54502)
2024-08-12 skia-flutter-autoroll@skia.org Roll Skia from f77adcef7c1c to ec7558d41b34 (1 revision) (flutter-team-archive/engine#54507)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jsimmons@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

macOS: Crash in attributedSubstringForProposedRange

3 participants