Skip to content

Commit b9b728b

Browse files
committed
Need to use preciseLength here to avoid too-short stream.
1 parent 911c6c0 commit b9b728b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/jruby/RubyString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5935,7 +5935,7 @@ else if (encidx == UTF32LEEncoding.INSTANCE) {
59355935
}
59365936

59375937
while (p < e) {
5938-
int ret = enc.length(pBytes, p, e);
5938+
int ret = StringSupport.preciseLength(enc, pBytes, p, e);
59395939
if (MBCLEN_NEEDMORE_P(ret)) {
59405940
break;
59415941
}

0 commit comments

Comments
 (0)