summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-02-02 22:15:01 +0000
committerAlan Conway <aconway@apache.org>2011-02-02 22:15:01 +0000
commit3f853420dc4af614f18370549358052f80fab4b1 (patch)
treeec337111475f8f41c3267b2854d6a4319de44087
parent552ad8d0deaf139db90244a383b7423296e4dc0d (diff)
downloadqpid-python-3f853420dc4af614f18370549358052f80fab4b1.tar.gz
QPID-3033 Bug 674183 - Segmentation fault while processing session.attach
If a faulty client sent invalid frames to a connection that was not yet in the open state, the broker would core dump. The fix is to close the connection with a 'framing-error' in this case. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1066661 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/broker/Connection.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp
index 82761ac7e4..460799280e 100644
--- a/cpp/src/qpid/broker/Connection.cpp
+++ b/cpp/src/qpid/broker/Connection.cpp
@@ -160,7 +160,10 @@ void Connection::received(framing::AMQFrame& frame) {
if (frame.getChannel() == 0 && frame.getMethod()) {
adapter.handle(frame);
} else {
- getChannel(frame.getChannel()).in(frame);
+ if (adapter.isOpen())
+ getChannel(frame.getChannel()).in(frame);
+ else
+ close(connection::CLOSE_CODE_FRAMING_ERROR, "Connection not yet open, invalid frame received.");
}
if (isLink) //i.e. we are acting as the client to another broker