imbajin commented on code in PR #2861:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2861#discussion_r2313269445


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BytesBuffer.java:
##########
@@ -249,7 +257,7 @@ public byte peek() {
     }
 
     public byte peekLast() {
-        return this.buffer.get(this.buffer.capacity() - 1);
+        return this.buffer.get(this.buffer.limit() - 1);

Review Comment:
   **Critical bug fix**: This change from `buffer.capacity() - 1` to 
`buffer.limit() - 1` is correct and important. Using capacity would access 
potentially uninitialized data beyond the actual buffer content.



-- 
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: issues-unsubscr...@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org
For additional commands, e-mail: issues-h...@hugegraph.apache.org

Reply via email to