Skip to content

Fix out-of-bounds write in TextPagerEdit#392

Merged
marcosbento merged 1 commit into
developfrom
fix/sigsegv_in_ui
Jul 16, 2026
Merged

Fix out-of-bounds write in TextPagerEdit#392
marcosbento merged 1 commit into
developfrom
fix/sigsegv_in_ui

Conversation

@marcosbento

@marcosbento marcosbento commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Description

See commit message(s).

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌦️ >> Documentation << 🌦️
https://sites.ecmwf.int/docs/dev-section/ecflow/pull-requests/PR-392

TextEditPrivate::actions was sized with the enumerator value
SelectAllAction (i.e. 1) rather than an element count, leaving room for
a single QAction while the constructor initialises two. The write to
actions[1] hit the adjacent sectionPressed member; being undefined
behaviour, at -O0 it merely corrupted that member, while at -O2 GCC 14
used the single-element bound to constrain the loop index and broke the
loop exit condition, making ecFlowUI segfault whenever a TextPagerEdit
was constructed, as is the case with Panels > Add info panel.

Introduce ActionCount and size the array with it, replace the
null-sentinel loop with a bounded loop, and tie the shortcut table to
ActionType with a static_assert.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.07%. Comparing base (790d164) to head (a4a57b9).

Files with missing lines Patch % Lines
Viewer/ecflowUI/src/TextPager/TextPagerEdit.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #392   +/-   ##
========================================
  Coverage    52.07%   52.07%           
========================================
  Files         1247     1247           
  Lines       101710   101710           
  Branches     15136    15136           
========================================
  Hits         52968    52968           
  Misses       48742    48742           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcosbento
marcosbento merged commit a4a57b9 into develop Jul 16, 2026
137 of 138 checks passed
@marcosbento
marcosbento deleted the fix/sigsegv_in_ui branch July 16, 2026 18:06
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.

2 participants