From 8335a1bbe8a190158c18f7fee128c00e01ee6aa6 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 12 Nov 2007 16:12:13 +0000 Subject: Minimal bounds checking git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@594198 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/Buffer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cpp/src/qpid/framing/Buffer.cpp') 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; } -- cgit v1.2.1