Author: gsim
Date: Fri Aug 26 10:51:26 2011
New Revision: 1162060

URL: http://svn.apache.org/viewvc?rev=1162060&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp?rev=1162060&r1=1162059&r2=1162060&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp Fri Aug 26 
10:51:26 2011
@@ -192,7 +192,7 @@ void ConnectionHandler::Handler::secureO
 void ConnectionHandler::Handler::tuneOk(uint16_t /*channelmax*/,
     uint16_t framemax, uint16_t heartbeat)
 {
-    connection.setFrameMax(framemax);
+    if (framemax) connection.setFrameMax(framemax);
     connection.setHeartbeatInterval(heartbeat);
 }
 

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp?rev=1162060&r1=1162059&r2=1162060&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp Fri Aug 26 
10:51:26 2011
@@ -57,6 +57,7 @@ size_t CyrusSecurityLayer::decode(const 
             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);
             }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscr...@qpid.apache.org

Reply via email to