mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
[Java] lookup by byteArray is giving back wrong entry (#6915)
This commit is contained in:
@@ -788,7 +788,12 @@ public class FlexBuffers {
|
||||
if (io == other.length) {
|
||||
// in our buffer we have an additional \0 byte
|
||||
// but this does not exist in regular Java strings, so we return now
|
||||
return c1 - c2;
|
||||
int cmp = c1 - c2;
|
||||
if (cmp != 0 || bb.get(ia) == '\0') {
|
||||
return cmp;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (c1 == c2);
|
||||
@@ -961,7 +966,12 @@ public class FlexBuffers {
|
||||
if (l2 == other.length) {
|
||||
// in our buffer we have an additional \0 byte
|
||||
// but this does not exist in regular Java strings, so we return now
|
||||
return c1 - c2;
|
||||
int cmp = c1 - c2;
|
||||
if (cmp != 0 || bb.get(l1) == '\0') {
|
||||
return cmp;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (c1 == c2);
|
||||
|
||||
Reference in New Issue
Block a user