Skip to content

fix: avoid regex backtracking in disk path normalization#2526

Merged
enoch85 merged 1 commit into
mainfrom
fix/arr-diskspace-redos
Mar 25, 2026
Merged

fix: avoid regex backtracking in disk path normalization#2526
enoch85 merged 1 commit into
mainfrom
fix/arr-diskspace-redos

Conversation

@enoch85

@enoch85 enoch85 commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace trailing-separator regex path normalization with a linear character scan
  • preserve Linux root paths and Windows drive roots while trimming redundant trailing separators
  • keep disk path matching behavior suitable for Docker, Linux, Windows, and UNC-style filesystem paths

Validation

  • yarn test
  • yarn check-types
  • exhaustive finite path-combination sweep in chat for normalization invariants
  • long-input benchmark confirmed the regex backtracking surface is removed

@enoch85 enoch85 merged commit 58ef57d into main Mar 25, 2026
12 checks passed
@enoch85 enoch85 deleted the fix/arr-diskspace-redos branch March 25, 2026 19:10
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

enoch85 added a commit that referenced this pull request May 17, 2026
- yarn format on the 9 files flagged by Formatting check.
- Replace inline `replace(/\/+$/, '')` with the codebase's
  `while + endsWith + slice` pattern (see PR #2526 normalizeDiskPath)
  to avoid the polynomial-regex CodeQL alert.
- Match the existing rule-executor variable name (`isJellyfin`) when
  extending the BoxSet sync-lag workaround to also cover Emby — same
  shape as the original two-server check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant