ConeyLiu opened a new pull request, #13815:
URL: https://github.com/apache/arrow/pull/13815
The following code of `BaseVariableWidthVector.handleSafe` could fail to
relocated because of int overflow and then led to `IndexOutOfBoundsException`
when we put the data into the vector.
```java
protected final void handleSafe(int index, int dataLength) {
while (index >= getValueCapacity())
{ reallocValidityAndOffsetBuffers(); }
final int startOffset = lastSet < 0 ? 0 : getStartOffset(lastSet + 1);
// Here, the startOffset + dataLength could overflow
while (valueBuffer.capacity() < (startOffset + dataLength))
{ reallocDataBuffer(); }
}
```
The offset width of `BaseVariableWidthVector` is 4, while the maximum memory
allocation is Long.MAX_VALUE. This makes the memory allocation check invalid.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]