CODEC-315: Fix possible IndexOutOfBoundException thrown by PhoneticEngine.encode method#223
Merged
garydgregory merged 1 commit intoNov 25, 2023
Conversation
garydgregory
requested changes
Nov 24, 2023
garydgregory
left a comment
Member
There was a problem hiding this comment.
@arthurscchan
Thank you for your PR.
Please see my comments.
Member
|
@arthurscchan |
7a6ce1d to
f6ab92f
Compare
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
f6ab92f to
ee02460
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #223 +/- ##
=========================================
Coverage 92.27% 92.27%
- Complexity 1742 1743 +1
=========================================
Files 67 67
Lines 4584 4585 +1
Branches 709 710 +1
=========================================
+ Hits 4230 4231 +1
Misses 242 242
Partials 112 112 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
asfgit
pushed a commit
that referenced
this pull request
Nov 25, 2023
PhoneticEngine.encode method #223
omosteven
pushed a commit
to omosteven/commons-codec-lab-work
that referenced
this pull request
Jan 8, 2025
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
omosteven
pushed a commit
to omosteven/commons-codec-lab-work
that referenced
this pull request
Jan 8, 2025
PhoneticEngine.encode method apache#223
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes possible StringIndexOutOfBoundsException and ArrayIndexOutOfBoundsException in src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java thrown by
PhoneticEngine.encode()when the provided string only contains one of the name prefix of the chosen NameType or only contain single quotation character.This PR fixes the parameter for the split method and adds a conditional check to ensure only strings and arrays are not empty before processing.
We found this bug using fuzzing by way of OSS-Fuzz. It is reported at https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64376 and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64395.