chaokunyang commented on code in PR #1650: URL: https://github.com/apache/incubator-fury/pull/1650#discussion_r1618613469
########## 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: later `result |= (UNSAFE.getByte(heapMemory, address + readIdx++) & 0x7F) << 28;` wqill read one more byte without check. If we lower threshold, we may get crash in such cases. -- 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: commits-unsubscr...@fury.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org For additional commands, e-mail: commits-h...@fury.apache.org