Repository navigation
[CP-stable]Fix bounds checking in FlAccessibleTextField - #188191
Conversation
|
@loic-sharma please fill out the PR description above, afterwards the release team will review this request. |
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
There was a problem hiding this comment.
Code Review
This pull request introduces bounds checking and clamping for text offsets in fl_accessible_text_field.cc to prevent out-of-bounds access, and adds corresponding unit tests in fl_accessible_text_field_test.cc. The feedback highlights multiple instances in the new tests where multiple variables are declared on a single line, violating the Google C++ Style Guide which requires each variable to be declared on its own line.
|
CI had a failure that stopped further tests from running. We need to investigate to determine the root cause. SHA at time of execution: fe94d23. Possible causes:
A blank commit, or merging to head, will be required to resume running CI for this PR. Error Details: Stack trace: |
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
|
Bump @robert-ancell for review to get this in this week's stable hotfix |
Add bounds validation to get_substring and get_string_at_offset to prevent out-of-bounds memory access when ATK clients pass offsets beyond the text length. - get_substring: clamp start and end to [0, length] and ensure start <= end before calling g_utf8_substring. - get_string_at_offset: clamp start and end to [0, n_attrs-1] before accessing the PangoLogAttr array. Add tests for offset-beyond-end, empty text, and offset-at-end boundary conditions.
fe94d23 to
0ecb603
Compare
a10d8ac
into
flutter:flutter-3.44-candidate.0
This pull request is created by automatic cherry pick workflow
Issue Link:
#188192
Impact Description:
Flutter Linux apps could crash if a Linux accessibility client sent incorrect requests.
Changelog Description:
[flutter/188192] Fix bounds checking in Flutter Linux's FlAccessibleTextField
Workaround:
None
Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
On Linux, use an accessibility tool to interact with a Flutter app that has a text field.