diff options
author | Mark Spruiell <mes@zeroc.com> | 2006-02-15 20:29:45 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2006-02-15 20:29:45 +0000 |
commit | 4a82c2cbe2e0a3450aff9f61a4194aa423f32b19 (patch) | |
tree | da33a3fb17718cdf1bf754b6ba775c211726bd54 /cpp/src/Ice/ThreadPool.cpp | |
parent | Fixed bug 864 (diff) | |
download | ice-4a82c2cbe2e0a3450aff9f61a4194aa423f32b19.tar.bz2 ice-4a82c2cbe2e0a3450aff9f61a4194aa423f32b19.tar.xz ice-4a82c2cbe2e0a3450aff9f61a4194aa423f32b19.zip |
changing assertion to exception to avoid vulnerability with small UDP
packets
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 8 |
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))); |