summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/framing/FrameDecoder.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/src/qpid/framing/FrameDecoder.cpp b/cpp/src/qpid/framing/FrameDecoder.cpp
index 1e73ee1e51..529cdd76a7 100644
--- a/cpp/src/qpid/framing/FrameDecoder.cpp
+++ b/cpp/src/qpid/framing/FrameDecoder.cpp
@@ -32,7 +32,8 @@ namespace {
/** Append up to n bytes from start of buf to end of bytes. */
void append(std::vector<char>& bytes, Buffer& buffer, size_t n) {
size_t oldSize = bytes.size();
- n = std::min(n, size_t(buffer.available()));
+ if ((n = std::min(n, size_t(buffer.available()))) == 0)
+ return;
bytes.resize(oldSize+n);
char* p = &bytes[oldSize];
buffer.getRawData(reinterpret_cast<uint8_t*>(p), n);