Skip to content

Commit

Permalink
Fix boundscheck lost in last String#rindex change.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 1, 2015
1 parent 78b3cfd commit 5a353b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/util/StringSupport.java
Expand Up @@ -926,7 +926,7 @@ private static int strRindex(ByteList str, ByteList sub, int s, int pos, Encodin
t = sub.begin();
slen = sub.realSize();

while (s >= sbeg) {
while (s >= sbeg && s + slen <= sbeg + str.realSize()) {
if (ByteList.memcmp(strBytes, s, subBytes, t, slen) == 0) {
return pos;
}
Expand Down

0 comments on commit 5a353b7

Please sign in to comment.