Skip to content

Commit dc1b0e5

Browse files
authored
Merge pull request #375 from msgpack/pack-str-state-fix
fix 'Unexpected UTF-8 encoder state' error at packString
2 parents c9fd454 + 0a8bc19 commit dc1b0e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ else if (s.length() < (1 << 16)) {
555555
position += written;
556556
}
557557
else {
558-
if (written >= (1 << 32)) {
558+
if (written >= (1L << 32)) { // this check does nothing because (1L << 32) is larger than Integer.MAX_VALUE
559559
// this must not happen because s.length() is less than 2^16 and (2^16) * UTF_8_MAX_CHAR_SIZE is less than 2^32
560560
throw new IllegalArgumentException("Unexpected UTF-8 encoder state");
561561
}

0 commit comments

Comments
 (0)