You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by ba...@apache.org on 2025/08/30 07:54:18 UTC
(iggy) 02/02: fix(go) add check payload len on DeserializeOffset
This is an automated email from the ASF dual-hosted git repository.
bashirbekov pushed a commit to branch fix-empty-payload-on-de-offset
in repository https://gitbox.apache.org/repos/asf/iggy.git
commit ea1142fec59949ad1f49961a0bd85534500645d7
Author: haze518 <as...@gmail.com>
AuthorDate: Sat Aug 30 13:53:57 2025 +0600
fix(go) add check payload len on DeserializeOffset
---
foreign/go/binary_serialization/binary_response_deserializer.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/foreign/go/binary_serialization/binary_response_deserializer.go b/foreign/go/binary_serialization/binary_response_deserializer.go
index c7490f57..bf9437cb 100644
--- a/foreign/go/binary_serialization/binary_response_deserializer.go
+++ b/foreign/go/binary_serialization/binary_response_deserializer.go
@@ -37,6 +37,10 @@ func DeserializeLogInResponse(payload []byte) *iggcon.IdentityInfo {
}
func DeserializeOffset(payload []byte) *iggcon.ConsumerOffsetInfo {
+ if len(payload) == 0 {
+ return nil
+ }
+
partitionId := binary.LittleEndian.Uint32(payload[0:4])
currentOffset := binary.LittleEndian.Uint64(payload[4:12])
storedOffset := binary.LittleEndian.Uint64(payload[12:20])