summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ConnectionI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/ConnectionI.cpp')
-rw-r--r--cpp/src/Ice/ConnectionI.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
index 9504acde619..10d7ade49de 100644
--- a/cpp/src/Ice/ConnectionI.cpp
+++ b/cpp/src/Ice/ConnectionI.cpp
@@ -2357,7 +2357,13 @@ Ice::ConnectionI::run()
_transceiver->read(stream, -1);
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)));