Skip to content

[CP-stable]Fix bounds checking in FlAccessibleTextField - #188191

Merged
auto-submit[bot] merged 1 commit into
flutter:flutter-3.44-candidate.0from
flutteractionsbot:cp-stable-1e36b1c023ef2683f08f41e041ce4f6c348acf9d
Jun 23, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:flutter-3.44-candidate.0from
flutteractionsbot:cp-stable-1e36b1c023ef2683f08f41e041ce4f6c348acf9d

Conversation

@flutteractionsbot

@flutteractionsbot flutteractionsbot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

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?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

On Linux, use an accessibility tool to interact with a Flutter app that has a text field.

@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Jun 18, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor Author

@loic-sharma please fill out the PR description above, afterwards the release team will review this request.

@flutteractionsbot
flutteractionsbot requested a review from a team as a code owner June 18, 2026 21:26
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Jun 18, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 18, 2026
@flutter-dashboard

Copy link
Copy Markdown

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.

@gemini-code-assist gemini-code-assist Bot 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.

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.

@github-actions github-actions Bot added a: text input Entering text in a text field or keyboard related problems engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically a: desktop Running on desktop team-linux Owned by the Linux platform team labels Jun 18, 2026
@flutter-dashboard

Copy link
Copy Markdown

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:

  • Configuration Changes: The .ci.yaml file might have been modified between the creation of this pull request and the start of this test run. This can lead to ci yaml validation errors.
  • Infrastructure Issues: Problems with the CI environment itself (e.g., quota) could have caused the failure.

A blank commit, or merging to head, will be required to resume running CI for this PR.

Error Details:

GitHub Error: You have exceeded a secondary rate limit. Please wait a few minutes before you try again. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) If you reach out to GitHub Support for help, please include the request ID B2BC:1D6FD6:91439D0:217A0E40:6A3467F4.

Stack trace:

#0      GitHub.handleStatusCode (package:github/src/common/github.dart:486:5)
#1      GitHub.request (package:github/src/common/github.dart:422:7)
<asynchronous suspension>
#2      GitHub.requestJson (package:github/src/common/github.dart:323:22)
<asynchronous suspension>
#3      RetryOptions.retry (package:retry/retry.dart:131:16)
<asynchronous suspension>
#4      LuciBuildService._scheduleTryBuilds (package:cocoon_service/src/service/luci_build_service.dart:307:26)
<asynchronous suspension>
#5      Scheduler._runCiTestingStage (package:cocoon_service/src/service/scheduler.dart:1476:9)
<asynchronous suspension>
#6      Scheduler.proceedToCiTestingStage (package:cocoon_service/src/service/scheduler.dart:1527:7)
<asynchronous suspension>
#7      Scheduler._closeSuccessfulEngineBuildStage (package:cocoon_service/src/service/scheduler.dart:1341:5)
<asynchronous suspension>
#8      Scheduler.processCheckRunCompleted (package:cocoon_service/src/service/scheduler.dart:1273:11)
<asynchronous suspension>
#9      PresubmitLuciSubscription.post (package:cocoon_service/src/request_handlers/presubmit_luci_subscription.dart:176:9)
<asynchronous suspension>
#10     RequestHandler.service (package:cocoon_service/src/request_handling/request_handler.dart:42:20)
<asynchronous suspension>
#11     SubscriptionHandler.service (package:cocoon_service/src/request_handling/subscription_handler.dart:139:5)
<asynchronous suspension>
#12     createServer.<anonymous closure> (package:cocoon_service/server.dart:448:7)
<asynchronous suspension>
#13     main.<anonymous closure>.<anonymous closure> (file:///app/app_dart/bin/gae_server.dart:187:9)
<asynchronous suspension>

@walley892 walley892 added CICD Run CI/CD and removed CICD Run CI/CD labels Jun 23, 2026
@fluttergithubbot

Copy link
Copy Markdown
Contributor

An existing Git SHA, fe94d2300512136ae392ddbd6b4415ea7d05af48, was detected, and no actions were taken.

To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with --force) that already was pushed before, push a blank commit (git commit --allow-empty -m "Trigger Build") or rebase to continue.

@walley892

Copy link
Copy Markdown
Contributor

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.
@loic-sharma
loic-sharma force-pushed the cp-stable-1e36b1c023ef2683f08f41e041ce4f6c348acf9d branch from fe94d23 to 0ecb603 Compare June 23, 2026 21:33
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 23, 2026
@walley892 walley892 added the CICD Run CI/CD label Jun 23, 2026
@walley892 walley892 added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels Jun 23, 2026
@auto-submit
auto-submit Bot merged commit a10d8ac into flutter:flutter-3.44-candidate.0 Jun 23, 2026
176 checks passed
@flutteractionsbot
flutteractionsbot deleted the cp-stable-1e36b1c023ef2683f08f41e041ce4f6c348acf9d branch July 20, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD cp: review Cherry-picks in the review queue engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically team-linux Owned by the Linux platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants