Skip to content

[io] fix TFileMerger kOnlyListed suffix key leak#22435

Merged
guitargeek merged 1 commit into
root-project:masterfrom
prakharsing7:io-tfilemerger-onlylisted-word-boundary
Jun 1, 2026
Merged

[io] fix TFileMerger kOnlyListed suffix key leak#22435
guitargeek merged 1 commit into
root-project:masterfrom
prakharsing7:io-tfilemerger-onlylisted-word-boundary

Conversation

@prakharsing7
Copy link
Copy Markdown
Contributor

@prakharsing7 prakharsing7 commented May 30, 2026

When using PartialMerge with kOnlyListed an unlisted key whose name is a prefix or suffix of a listed key was incorrectly included in the merged output, because the name check was a plain substring search with no leading word boundary.

This Pull request:

Changes or fixes: #22414

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

An unlisted key whose name is a prefix or suffix of a listed key was
incorrectly included in the merged output, because the name check was
a plain substring search with no leading word boundary.

Fixes root-project#22414
@prakharsing7 prakharsing7 requested a review from pcanal as a code owner May 30, 2026 14:22
Comment thread io/io/test/TFileMergerTests.cxx
Copy link
Copy Markdown
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

Thanks.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes TFileMerger::kOnlyListed object selection so listed object names are matched as space-delimited tokens, preventing unlisted keys whose names are suffixes of listed keys from being merged.

Changes:

  • Updates TFileMerger::MergeOne to search for " key " within a space-prefixed object-name list.
  • Adds a regression test covering suffix/prefix-like names when using kOnlyListed.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
io/io/src/TFileMerger.cxx Tightens kOnlyListed name matching to require a leading delimiter.
io/io/test/TFileMergerTests.cxx Adds regression coverage ensuring only the explicitly listed key is merged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

Test Results

    22 files      22 suites   3d 11h 12m 57s ⏱️
 3 863 tests  3 862 ✅ 0 💤 1 ❌
76 179 runs  76 178 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 3379b33.

♻️ This comment has been updated with latest results.

@guitargeek guitargeek merged commit 2c052eb into root-project:master Jun 1, 2026
55 of 58 checks passed
@guitargeek
Copy link
Copy Markdown
Contributor

/backport to 6.40

@root-project-bot
Copy link
Copy Markdown

Preparing to backport PR #22435 to branch 6.40 requested by guitargeek

@root-project-bot
Copy link
Copy Markdown

This PR has been backported to branch 6.40: #22445

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.

TFileMerger: when using kOnlyListed, any 'listed' key will bring in any unlisted keys that are a suffix of a listed key

5 participants