diff options
-rw-r--r-- | common/resourceaccess.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 6863193..e49802b 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -600,7 +600,8 @@ bool ResourceAccess::processMessageBuffer() | |||
600 | { | 600 | { |
601 | static const int headerSize = Commands::headerSize(); | 601 | static const int headerSize = Commands::headerSize(); |
602 | if (d->partialMessageBuffer.size() < headerSize) { | 602 | if (d->partialMessageBuffer.size() < headerSize) { |
603 | SinkWarning() << "command too small"; | 603 | //This is not an error |
604 | SinkTrace() << "command too small, smaller than headerSize: " << d->partialMessageBuffer.size() << headerSize; | ||
604 | return false; | 605 | return false; |
605 | } | 606 | } |
606 | 607 | ||
@@ -608,8 +609,10 @@ bool ResourceAccess::processMessageBuffer() | |||
608 | const int commandId = *(const int *)(d->partialMessageBuffer.constData() + sizeof(uint)); | 609 | const int commandId = *(const int *)(d->partialMessageBuffer.constData() + sizeof(uint)); |
609 | const uint size = *(const int *)(d->partialMessageBuffer.constData() + sizeof(int) + sizeof(uint)); | 610 | const uint size = *(const int *)(d->partialMessageBuffer.constData() + sizeof(int) + sizeof(uint)); |
610 | 611 | ||
611 | if (size > (uint)(d->partialMessageBuffer.size() - headerSize)) { | 612 | const uint availableMessageSize = d->partialMessageBuffer.size() - headerSize; |
612 | SinkWarning() << "command too small"; | 613 | if (size > availableMessageSize) { |
614 | //This is not an error | ||
615 | SinkTrace() << "command too small, message smaller than advertised: " << availableMessageSize << headerSize; | ||
613 | return false; | 616 | return false; |
614 | } | 617 | } |
615 | 618 | ||