Skip to content

fix: Potential infinite loop in recursive splitting#29

Open
mrwind-up-bird wants to merge 1 commit intomainfrom
autofix/dd2853cd/potential-infinite-loop-in-rec
Open

fix: Potential infinite loop in recursive splitting#29
mrwind-up-bird wants to merge 1 commit intomainfrom
autofix/dd2853cd/potential-infinite-loop-in-rec

Conversation

@mrwind-up-bird
Copy link
Copy Markdown
Collaborator

AutoFix: Potential infinite loop in recursive splitting

Category: bug
Severity: low

Issue

The _recursive_split function could theoretically enter infinite recursion if a separator produces parts that are still too large and no character-level fallback is reached, though this is unlikely with the current separator list.

Fix

Added a recursion depth limit parameter to prevent infinite loops. If recursion depth exceeds 50 levels, the function falls back to character-level splitting to guarantee termination. This maintains existing functionality while preventing the theoretical infinite recursion scenario.


Generated by nyxCore AutoFix

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.

1 participant