diff options
author | Gordon Sim <gsim@apache.org> | 2007-11-12 16:12:13 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-11-12 16:12:13 +0000 |
commit | 8335a1bbe8a190158c18f7fee128c00e01ee6aa6 (patch) | |
tree | b5d36f261d0072878e1bd09e7704c8f0311b2c6d /cpp/src/qpid/framing/Buffer.cpp | |
parent | df5ec6f74a070a5e6f67168124839b6c638ef918 (diff) | |
download | qpid-python-8335a1bbe8a190158c18f7fee128c00e01ee6aa6.tar.gz |
Minimal bounds checking
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@594198 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/Buffer.cpp')
-rw-r--r-- | cpp/src/qpid/framing/Buffer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cpp/src/qpid/framing/Buffer.cpp b/cpp/src/qpid/framing/Buffer.cpp index eaa4433b5f..b42797414f 100644 --- a/cpp/src/qpid/framing/Buffer.cpp +++ b/cpp/src/qpid/framing/Buffer.cpp @@ -164,12 +164,14 @@ void Buffer::putLongString(const string& s){ void Buffer::getShortString(string& s){ uint8_t len = getOctet(); + checkAvailable(len); s.assign(data + position, len); position += len; } void Buffer::getLongString(string& s){ uint32_t len = getLong(); + checkAvailable(len); s.assign(data + position, len); position += len; } @@ -181,6 +183,7 @@ void Buffer::putRawData(const string& s){ } void Buffer::getRawData(string& s, uint32_t len){ + checkAvailable(len); s.assign(data + position, len); position += len; } @@ -191,6 +194,7 @@ void Buffer::putRawData(const uint8_t* s, size_t len){ } void Buffer::getRawData(uint8_t* s, size_t len){ + checkAvailable(len); memcpy(s, data + position, len); position += len; } |