diff options
author | Gordon Sim <gsim@apache.org> | 2011-08-26 10:51:26 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2011-08-26 10:51:26 +0000 |
commit | 78ee8df255be3c8bce2bfe747eecdbcd7f1e78cf (patch) | |
tree | e3b401e081c1745e1538ff1de912d7a6b6ce9719 | |
parent | 251b429eec508db64cf10b859c92e7ffd3119a1e (diff) | |
download | qpid-python-78ee8df255be3c8bce2bfe747eecdbcd7f1e78cf.tar.gz |
QPID-3455: Don't treat unspecified frame size as implying the minimum value. Prevent infinite loop when unable to decode frame in SASL security layer.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1162060 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/broker/ConnectionHandler.cpp | 2 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp index 948aa04417..015002a70c 100644 --- a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp +++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp @@ -192,7 +192,7 @@ void ConnectionHandler::Handler::secureOk(const string& response) void ConnectionHandler::Handler::tuneOk(uint16_t /*channelmax*/, uint16_t framemax, uint16_t heartbeat) { - connection.setFrameMax(framemax); + if (framemax) connection.setFrameMax(framemax); connection.setHeartbeatInterval(heartbeat); } diff --git a/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp b/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp index 3d868da64b..249b769051 100644 --- a/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp +++ b/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp @@ -57,6 +57,7 @@ size_t CyrusSecurityLayer::decode(const char* input, size_t size) copied += count; decodeBuffer.position += count; size_t decodedSize = codec->decode(decodeBuffer.data, decodeBuffer.position); + if (decodedSize == 0) break; if (decodedSize < decodeBuffer.position) { ::memmove(decodeBuffer.data, decodeBuffer.data + decodedSize, decodeBuffer.position - decodedSize); } |