Skip to content

Conversation

bjlaub
Copy link
Contributor

@bjlaub bjlaub commented Mar 20, 2025

It's possible for StatusData#getFormattedStatus to throw an ArrayIndexOutOfBoundsException if given a message with a non-null, 0-length parameters array, because there is no bounds check on the indexing into this array.

Fixes #3562

Checklist

  • Base your changes on 2.x branch if you are targeting Log4j 2; use main otherwise
  • ./mvnw verify succeeds (if it fails due to code formatting issues reported by Spotless, simply run ./mvnw spotless:apply and retry)
  • Non-trivial changes contain an entry file in the src/changelog/.2.x.x directory
  • Tests for the changes are provided
  • Commits are signed (optional, but highly recommended)

@ppkarwasz
Copy link
Contributor

@bjlaub,

Thank you! Can you add a changelog entry in src/changelog/.2.x.x?

Copy link

github-actions bot commented Mar 21, 2025

Job Requested goals Build Tool Version Build Outcome Build Scan®
build-macos-latest clean install 3.9.8 Build Scan PUBLISHED
build-ubuntu-latest clean install 3.9.8 Build Scan PUBLISHED
build-windows-latest clean install 3.9.8 Build Scan PUBLISHED
Generated by gradle/develocity-actions

@vy vy added bug Incorrect, unexpected, or unintended behavior of existing code api Affects the public API labels Mar 21, 2025
@bjlaub
Copy link
Contributor Author

bjlaub commented Mar 21, 2025

Can you add a changelog entry in src/changelog/.2.x.x?

yep, added!

@ppkarwasz ppkarwasz force-pushed the fix_statusdata_bounds_check branch from f32587d to e252a00 Compare March 21, 2025 22:32
@vy vy merged commit 93afabc into apache:2.x Mar 24, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Affects the public API bug Incorrect, unexpected, or unintended behavior of existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StatusData#getFormattedStatus can throw ArrayIndexOutOfBoundsException

3 participants