summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ThreadPool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r--cpp/src/Ice/ThreadPool.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index ec0e7e3b6b5..15bda6f74fe 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -755,7 +755,13 @@ IceInternal::ThreadPool::read(const EventHandlerPtr& handler)
}
ptrdiff_t pos = stream.i - stream.b.begin();
- assert(pos >= headerSize);
+ if(pos < headerSize)
+ {
+ //
+ // This situation is possible for small UDP packets.
+ //
+ throw IllegalMessageSizeException(__FILE__, __LINE__);
+ }
stream.i = stream.b.begin();
pair<const Byte*, const Byte*> m;
stream.readBlob(m, static_cast<Int>(sizeof(magic)));