[
https://issues.apache.org/jira/browse/LANG-1162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14680816#comment-14680816
]
Sebb commented on LANG-1162:
----------------------------
Fixed equals():
Repository: commons-lang
Updated Branches:
refs/heads/master fad946a1d -> 6849dfc8a
LANG-1162 StringUtils#equals fails with Index OOBE on non-Strings with
identical leading prefix
Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/6849dfc8
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/6849dfc8
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/6849dfc8
TODO: fix regionMatches?
> StringUtils#equals fails with Index OOBE on non-Strings with identical
> leading prefix
> -------------------------------------------------------------------------------------
>
> Key: LANG-1162
> URL: https://issues.apache.org/jira/browse/LANG-1162
> Project: Commons Lang
> Issue Type: Bug
> Affects Versions: 3.4
> Reporter: Sebb
> Assignee: Sebb
>
> From the Commons User mailing list:
> {quote}
> StringUtils.equals(cs1,cs2) delegates to CharSequence.regionMatches(...) in a
> way that causes IndexOutOfBounds when either of cs1/cs2 isn't a String.
> Specifically, comparing "foo" and "foobar" for non-String CharSequences bombs
> due to CharSequenceUtils.regionMatches(cs1, false, 0, cs2, 0,
> Math.max(cs1.length(), cs2.length())) because regionMatches doesn't check for
> input exhaustion.
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)