We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c1723a commit e1aa7f0Copy full SHA for e1aa7f0
agent/protocol/decoder.go
@@ -116,7 +116,7 @@ func ExtractBEInt[TIntType int8 | int16 | int32 | uint32 | uint8 | int64](d *Bin
116
117
func ExtractLEInt[TIntType int32 | uint32 | uint8](d *BinaryDecoder) (TIntType, error) {
118
typeSize := int(reflect.TypeOf(TIntType(0)).Size())
119
- if len(d.str) < 4 {
+ if len(d.str) < typeSize {
120
return 0, ResourceNotAvailble
121
}
122
var x TIntType = 0
@@ -142,7 +142,7 @@ func BEndianBytesToInt[TIntType int32 | uint32 | uint8](d *BinaryDecoder) TIntTy
142
143
func LEndianBytesToInt[TIntType int32 | uint32 | uint8](d *BinaryDecoder) TIntType {
144
145
146
return 0
147
148
0 commit comments