Skip to content

Commit badfcf5

Browse files
Fix the bug for empty payload (#26195)
2 parents 42bebf4 + fa330e6 commit badfcf5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ydb/core/persqueue/pqtablet/blob/blob_serialization.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ TClientBlob DeserializeClientBlob(const char* data, ui32 size) {
181181
AFL_ENSURE(data < end);
182182
ui16 sz = ReadUnaligned<ui16>(data);
183183
data += sizeof(ui16);
184-
AFL_ENSURE(data + sz < end);
184+
AFL_ENSURE(data + sz <= end);
185185
TString sourceId(data, sz);
186186
data += sz;
187187

188-
AFL_ENSURE(data < end)("size", size)("SeqNo", seqNo)("SourceId", sourceId);
189-
190-
TString dt(data, end - data);
191-
188+
TString dt;
189+
if (data != end) {
190+
dt = TString(data, end - data);
191+
}
192192
return TClientBlob(std::move(sourceId), seqNo, std::move(dt), partData, writeTimestamp, createTimestamp, uncompressedSize, std::move(partitionKey), std::move(explicitHashKey));
193193
}
194194

0 commit comments

Comments
 (0)