atharvalade opened a new issue, #3131:
URL: https://github.com/apache/iggy/issues/3131

   
   `DeserializeClient` pre-allocates with `make([]ConsumerGroupInfo, Count)` 
then uses `append`, resulting in leading zero-value entries followed by the 
real data. The outer `for position < length` loop can also re-read groups if 
there are trailing bytes.
   
   **File:** `foreign/go/binary_serialization/binary_response_deserializer.go` 
lines 539-558
   ```go
   consumerGroups := make([]iggcon.ConsumerGroupInfo, 
clientInfo.ConsumerGroupsCount)
   // ...
   for position < length {
       for i := uint32(0); i < clientInfo.ConsumerGroupsCount; i++ {
           // ...
           consumerGroups = append(consumerGroups, consumerGroup)
           position += 12
       }
   }
   ```
   
   Client metadata always contains ConsumerGroupsCount extra zero-valued 
entries. If trailing bytes exist, groups are duplicated. Same bug exists in C# 
SDK (BinaryMapper.MapClient).
   
   Gotta use make([], 0, Count) instead of make([], Count) and break after one 
pass through the inner loop.


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

Reply via email to