Browse Source

Remove OutStream::skip()

It might leak data depending on what's in the buffer. Use pad() instead
where blank space is needed.
tags/v1.11.90
Pierre Ossman 4 years ago
parent
commit
dc38699af8
2 changed files with 1 additions and 9 deletions
  1. 0
    8
      common/rdr/OutStream.h
  2. 1
    1
      common/rfb/CMsgWriter.cxx

+ 0
- 8
common/rdr/OutStream.h View File

@@ -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) {

+ 1
- 1
common/rfb/CMsgWriter.cxx View File

@@ -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);

Loading…
Cancel
Save