It might leak data depending on what's in the buffer. Use pad() instead where blank space is needed.tags/v1.11.90
@@ -83,14 +83,6 @@ namespace rdr { | |||
while (bytes-- > 0) writeU8(0); | |||
} | |||
inline void skip(size_t bytes) { | |||
while (bytes > 0) { | |||
size_t n = check(1, bytes); | |||
ptr += n; | |||
bytes -= n; | |||
} | |||
} | |||
// writeBytes() writes an exact number of bytes. | |||
void writeBytes(const void* data, size_t length) { |
@@ -61,7 +61,7 @@ void CMsgWriter::writeSetEncodings(const std::list<rdr::U32> encodings) | |||
{ | |||
std::list<rdr::U32>::const_iterator iter; | |||
startMsg(msgTypeSetEncodings); | |||
os->skip(1); | |||
os->pad(1); | |||
os->writeU16(encodings.size()); | |||
for (iter = encodings.begin(); iter != encodings.end(); ++iter) | |||
os->writeU32(*iter); |