From 289afd9b5c6a4c982d1c167180006d8101184e4d Mon Sep 17 00:00:00 2001 From: Jason Duell Date: Tue, 20 Dec 2011 00:20:12 -0800 Subject: [PATCH] Bug 711205: Limit websocket outbound msg size to PR_INT32_MAX. r=mcmanus --- netwerk/protocol/websocket/WebSocketChannel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index 3847627d0ad..0959f406d25 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -2373,6 +2373,11 @@ WebSocketChannel::SendMsgCommon(const nsACString *aMsg, bool aIsBinary, return NS_ERROR_NOT_CONNECTED; } + if (aLength > mMaxMessageSize) { + LOG(("WebSocketChannel:: Error: message too big\n")); + return NS_ERROR_FILE_TOO_BIG; + } + return mSocketThread->Dispatch( aStream ? new OutboundEnqueuer(this, new OutboundMessage(aStream, aLength)) : new OutboundEnqueuer(this,