mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-11 10:04:06 +00:00
Fixed UBSan report in ProtobufWriter
This commit is contained in:
parent
c3f82f0b8c
commit
bc74013f98
@ -141,7 +141,8 @@ void ProtobufWriter::SimpleWriter::endMessage()
|
||||
size_t size_of_message = buffer.size() - num_bytes_skipped;
|
||||
writeVarint(size_of_message, out);
|
||||
for (const auto & piece : pieces)
|
||||
out.write(reinterpret_cast<char *>(&buffer[piece.start]), piece.end - piece.start);
|
||||
if (piece.end > piece.start)
|
||||
out.write(reinterpret_cast<char *>(&buffer[piece.start]), piece.end - piece.start);
|
||||
buffer.clear();
|
||||
pieces.clear();
|
||||
num_bytes_skipped = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user