Added pointer index check to StructReader._pointerFieldIsNull and StructBuilder._pointerFieldIsNull
This fixes an IndexOutOfBoundsException when checking for existence of later added fields which are only known on the receiver side (working with different schema versions)
This commit is contained in:
parent
633b1f6199
commit
906bab78f9
2 changed files with 2 additions and 2 deletions
|
@ -167,7 +167,7 @@ public class StructBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final boolean _pointerFieldIsNull(int ptrIndex) {
|
protected final boolean _pointerFieldIsNull(int ptrIndex) {
|
||||||
return this.segment.buffer.getLong((this.pointers + ptrIndex) * Constants.BYTES_PER_WORD) == 0;
|
return ptrIndex >= this.pointerCount || this.segment.buffer.getLong((this.pointers + ptrIndex) * Constants.BYTES_PER_WORD) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void _clearPointerField(int ptrIndex) {
|
protected final void _clearPointerField(int ptrIndex) {
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class StructReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final boolean _pointerFieldIsNull(int ptrIndex) {
|
protected final boolean _pointerFieldIsNull(int ptrIndex) {
|
||||||
return this.segment.buffer.getLong((this.pointers + ptrIndex) * Constants.BYTES_PER_WORD) == 0;
|
return ptrIndex >= this.pointerCount || this.segment.buffer.getLong((this.pointers + ptrIndex) * Constants.BYTES_PER_WORD) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <T> T _getPointerField(FromPointerReader<T> factory, int ptrIndex) {
|
protected final <T> T _getPointerField(FromPointerReader<T> factory, int ptrIndex) {
|
||||||
|
|
Loading…
Reference in a new issue