aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/SMsgWriter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb/SMsgWriter.cxx')
-rw-r--r--common/rfb/SMsgWriter.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/rfb/SMsgWriter.cxx b/common/rfb/SMsgWriter.cxx
index cf3264e8..bc3f4398 100644
--- a/common/rfb/SMsgWriter.cxx
+++ b/common/rfb/SMsgWriter.cxx
@@ -101,7 +101,9 @@ void SMsgWriter::writeFence(rdr::U32 flags, unsigned len, const char data[])
os->writeU32(flags);
os->writeU8(len);
- os->writeBytes(data, len);
+
+ if (len > 0)
+ os->writeBytes(data, len);
endMsg();
}