summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/BasicStream.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2009-08-18 08:50:04 +1000
committerMichi Henning <michi@zeroc.com>2009-08-18 08:50:04 +1000
commit09445fc755dad18490d4a09b96ebc50af72d56b7 (patch)
tree8317e58d1f39ac1fbada52b8f6ea41d4ac8bb8e1 /cpp/src/Ice/BasicStream.cpp
parentMore changes for 3996 (diff)
downloadice-09445fc755dad18490d4a09b96ebc50af72d56b7.tar.bz2
ice-09445fc755dad18490d4a09b96ebc50af72d56b7.tar.xz
ice-09445fc755dad18490d4a09b96ebc50af72d56b7.zip
Bug 4201 - No checks on the encapsulation size
Diffstat (limited to 'cpp/src/Ice/BasicStream.cpp')
-rw-r--r--cpp/src/Ice/BasicStream.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp
index 9b0f6c560f6..779cc2db7f4 100644
--- a/cpp/src/Ice/BasicStream.cpp
+++ b/cpp/src/Ice/BasicStream.cpp
@@ -325,9 +325,9 @@ IceInternal::BasicStream::skipEncaps()
{
Int sz;
read(sz);
- if(sz < 0)
+ if(sz < 6)
{
- throw NegativeSizeException(__FILE__, __LINE__);
+ throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
if(i - sizeof(Int) + sz > b.end())
{
@@ -368,9 +368,9 @@ IceInternal::BasicStream::startReadSlice()
{
Int sz;
read(sz);
- if(sz < 0)
+ if(sz < 4)
{
- throw NegativeSizeException(__FILE__, __LINE__);
+ throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
_readSlice = i - b.begin();
}
@@ -385,9 +385,9 @@ IceInternal::BasicStream::skipSlice()
{
Int sz;
read(sz);
- if(sz < 0)
+ if(sz < 4)
{
- throw NegativeSizeException(__FILE__, __LINE__);
+ throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
i += sz - sizeof(Int);
if(i > b.end())
@@ -2124,12 +2124,6 @@ IceInternal::BasicStream::throwUnmarshalOutOfBoundsException(const char* file, i
}
void
-IceInternal::BasicStream::throwNegativeSizeException(const char* file, int line)
-{
- throw NegativeSizeException(file, line);
-}
-
-void
IceInternal::BasicStream::throwUnsupportedEncodingException(const char* file, int line, Byte eMajor, Byte eMinor)
{
UnsupportedEncodingException ex(file, line);