diff options
| author | Stephen D. Huston <shuston@apache.org> | 2009-06-26 22:13:33 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2009-06-26 22:13:33 +0000 |
| commit | 653408785ddf0011e87d5c44d7996e8aeb49eb2a (patch) | |
| tree | 035454f6ed5086d9a716f723137af5d2128cbf26 /qpid/cpp | |
| parent | 9c733ae0a416c0c9c14a9006c17f2df1343e467e (diff) | |
| download | qpid-python-653408785ddf0011e87d5c44d7996e8aeb49eb2a.tar.gz | |
Fix out-of-range vector access; fixes QPID-1957
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@788886 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/framing/FrameDecoder.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/framing/FrameDecoder.cpp b/qpid/cpp/src/qpid/framing/FrameDecoder.cpp index 1e73ee1e51..529cdd76a7 100644 --- a/qpid/cpp/src/qpid/framing/FrameDecoder.cpp +++ b/qpid/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); |
