diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 7 | ||||
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index fae01eb0724..117154d015d 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -279,3 +279,10 @@ Ice::AbortBatchRequestException::ice_print(ostream& out) const Exception::ice_print(out); out << ":\nprotocol error: batch request was aborted"; } + +void +Ice::IllegalMessageSizeException::ice_print(ostream& out) const +{ + Exception::ice_print(out); + out << ":\nprotocol error: illegal message size"; +} diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index a2bd4415d25..70ff78e3da0 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -520,6 +520,10 @@ IceInternal::ThreadPool::read(const EventHandlerPtr& handler) stream.read(messageType); Int size; stream.read(size); + if (size < headerSize) + { + throw IllegalMessageSizeException(__FILE__, __LINE__); + } if (size > 1024 * 1024) // TODO: configurable { throw MemoryLimitException(__FILE__, __LINE__); |