lib/storage: fix SearchQuery.Unmarshal() after 32193b6059

This commit is contained in:
Aliaksandr Valialkin 2024-05-14 01:38:53 +02:00
parent 32193b6059
commit 207b4bd91d
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -445,14 +445,14 @@ func (sq *SearchQuery) Unmarshal(src []byte) ([]byte, error) {
if len(src) < 4 {
return src, fmt.Errorf("cannot unmarshal AccountID: too short src len: %d; must be at least %d bytes", len(src), 4)
}
src = src[4:]
sq.AccountID = encoding.UnmarshalUint32(src)
src = src[4:]
if len(src) < 4 {
return src, fmt.Errorf("cannot unmarshal ProjectID: too short src len: %d; must be at least %d bytes", len(src), 4)
}
src = src[4:]
sq.ProjectID = encoding.UnmarshalUint32(src)
src = src[4:]
minTs, nSize := encoding.UnmarshalVarInt64(src)
if nSize <= 0 {