8000 Fix potential ArrayIndexOutOfBoundsException by lefou · Pull Request #4769 · com-lihaoyi/mill · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix potential ArrayIndexOutOfBoundsException #4769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

lefou
Copy link
Member
@lefou lefou commented Mar 25, 2025

Fix #4768

Ensure we don't use a negative index in case a string is empty.

Copy link
Member
@lihaoyi lihaoyi left a comment

Choose a reason for hiding this comment

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

ship it. Maybe add a comment about when it happens? I guess when there's a empty line (i.e. two back-to-back newlines) with colors being applied before?

@lefou
Copy link
Member Author
lefou commented Mar 25, 2025

Unfortunately, I don't know in which situations it can happen. I just added a check for a potential issue, since we don't check the length of s before we substract 1.

@lefou
Copy link
Member Author
lefou 8000 commented Mar 25, 2025

Could be the process (Maven) is itself messing with ansi sequences and the ErrorMode.Sanitize results in a resulting length of 0.

@lihaoyi
Copy link
Member
lihaoyi commented Mar 25, 2025

Sounds good, go ahead then

@lefou lefou merged commit 2bc69a7 into com-lihaoyi:main Mar 25, 2025
31 of 33 checks passed
@lefou lefou deleted the fix-array-index branch March 25, 2025 09:41
@lefou lefou added this to the 0.13.0 milestone Mar 25, 2025
lefou added a commit to lefou/mill that referenced this pull request Mar 25, 2025
)

Fix com-lihaoyi#4768

Ensure we don't use a negative index in case a string is empty.

Original Pull request: com-lihaoyi#4769
lefou added a commit that referenced this pull request Mar 25, 2025
Fix #4768

Ensure we don't use a negative index in case a string is empty.

Original Pull request: #4769

Pull request: #4770
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.

ArrayIndexOutOfBoundsException in InputPumper
2 participants
0