You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
java.lang.ArrayIndexOutOfBoundsException: 3
at com.esotericsoftware.kryo.kryo5.serializers.CompatibleFieldSerializer.readFields(CompatibleFieldSerializer.java:229)
at com.esotericsoftware.kryo.kryo5.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:123)
at com.esotericsoftware.kryo.kryo5.Kryo.readClassAndObject(Kryo.java:810)
com.esotericsoftware.kryo.kryo5.serializers.CompatibleFieldSerializer.readFields implement a binary search, but there is a bug of the implementation of binary search algorithm.
int low, mid, high, compare;
int lastFieldIndex = allFields.length;
outer:
for (int i = 0; i < length; i++) {
String schemaName = names[i];
low = 0;
high = lastFieldIndex; // should use lastFieldIndex - 1
while (low <= high) {
mid = (low + high) >>> 1;
compare = schemaName.compareTo(allFields[mid].name);
if (compare < 0)
high = mid - 1;
else if (compare > 0)
low = mid + 1;
else {
fields[i] = allFields[mid];
continue outer;
}
}
To Reproduce
The following code simulate the object layout is different with serialize side and deserialize side.
Describe the bug
java.lang.ArrayIndexOutOfBoundsException: 3
com.esotericsoftware.kryo.kryo5.serializers.CompatibleFieldSerializer.readFields implement a binary search, but there is a bug of the implementation of binary search algorithm.
To Reproduce
The following code simulate the object layout is different with serialize side and deserialize side.
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: