Validated file expected size #4584

This commit is contained in:
Jerry (Xinyu Hou) 2015-06-04 10:19:36 -07:00
parent 8c64cbf54e
commit e0903983ad
1 changed files with 6 additions and 0 deletions

View File

@ -114,6 +114,12 @@ FileChunk::assemble(synergy::IStream* stream, String& dataReceived, size_t& expe
return kNotFinish;
case kDataEnd:
if (expectedSize != dataReceived.size()) {
LOG((CLOG_ERR "corrupted clipboard data, expected size=%d actual size=%d", expectedSize, dataReceived.size()));
LOG((CLOG_NOTIFY "File Transmission Failed: Corrupted file data."));
return kError;
}
if (CLOG->getFilter() >= kDEBUG2) {
LOG((CLOG_DEBUG2 "file data transfer finished"));
elapsedTime += stopwatch.getTime();