summaryrefslogtreecommitdiff
path: root/cpp
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
commit2a0ce0b675114f8a0ac501e488433823ac57f418 (patch)
treeec337111475f8f41c3267b2854d6a4319de44087 /cpp
parentd8a9c68160de71429179037b106e861834ec3350 (diff)
downloadqpid-python-2a0ce0b675114f8a0ac501e488433823ac57f418.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
Diffstat (limited to 'cpp')
-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