belliottsmith commented on code in PR #4078:
URL: https://github.com/apache/cassandra/pull/4078#discussion_r2040341869


##########
src/java/org/apache/cassandra/db/marshal/ByteBufferAccessor.java:
##########
@@ -318,13 +318,13 @@ public int putFloat(ByteBuffer dst, int offset, float 
value)
     @Override
     public int putLeastSignificantBytes(ByteBuffer dst, int offset, long 
register, int bytes)
     {
-        if (dst.remaining() < Long.BYTES)
+        int pos = dst.position() + offset;

Review Comment:
   It’s buggy without the changes, found via a small fuzz test of a serializer 
I wrote recently, though it predates this patch and is a false diff I think due 
to GitHub being confused about the base. 
   
   I can’t say for sure why your fuzz test isn’t demonstrating the issue, but 
should be fairly straightforward to see from code inspection that if offset is 
non-zero and we’re near the end (but the buffer isn’t) we’ll erroneously think 
we can call getLong when there may not be enough buffer to read.



-- 
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]

Reply via email to