chaokunyang commented on code in PR #1650:
URL: https://github.com/apache/incubator-fury/pull/1650#discussion_r1618852855
##########
java/fury-core/src/main/java/org/apache/fury/memory/MemoryBuffer.java:
##########
@@ -1774,7 +1774,7 @@ private long readVarUint36Slow() {
/** Reads the 1-5 byte int part of a non-negative varint. */
public int readVarUint32() {
int readIdx = readerIndex;
- if (size - readIdx < 5) {
+ if (size - readIdx < 4) {
Review Comment:
As you can see, we have `address + readIdx++`. It will read the 5rd bytes
without range check. This will crash jvm if we don't have such big buffer or
data is maliciously constructed
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]