summaryrefslogtreecommitdiff
path: root/cpp/include/Ice/InputStream.h
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-05-09 23:31:16 +0200
committerJose <jose@zeroc.com>2016-05-09 23:31:16 +0200
commit464ac5419aba884ee1783f5f67286a3c7aa72d3e (patch)
tree75d53a81f5972f7969998bd40aa21c1ec26ed672 /cpp/include/Ice/InputStream.h
parentMerge remote-tracking branch 'origin/3.6' (diff)
downloadice-464ac5419aba884ee1783f5f67286a3c7aa72d3e.tar.bz2
ice-464ac5419aba884ee1783f5f67286a3c7aa72d3e.tar.xz
ice-464ac5419aba884ee1783f5f67286a3c7aa72d3e.zip
Conflict fixes from previous commit
Diffstat (limited to 'cpp/include/Ice/InputStream.h')
-rw-r--r--cpp/include/Ice/InputStream.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/cpp/include/Ice/InputStream.h b/cpp/include/Ice/InputStream.h
index 570564ef218..157da22b0fb 100644
--- a/cpp/include/Ice/InputStream.h
+++ b/cpp/include/Ice/InputStream.h
@@ -249,20 +249,31 @@ public:
EncodingVersion skipEmptyEncapsulation()
{
- Int sz;
+ Ice::Int sz;
read(sz);
- if(sz != static_cast<Int>(sizeof(Int)) + 2)
+ if(sz < 6)
{
throwEncapsulationException(__FILE__, __LINE__);
}
-
- if(i + 2 > b.end())
+ if(i - sizeof(Ice::Int) + sz > b.end())
{
throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
-
- EncodingVersion encoding;
+ Ice::EncodingVersion encoding;
read(encoding);
+ if(encoding == Ice::Encoding_1_0)
+ {
+ if(sz != static_cast<Ice::Int>(sizeof(Ice::Int)) + 2)
+ {
+ throwEncapsulationException(__FILE__, __LINE__);
+ }
+ }
+ else
+ {
+ // Skip the optional content of the encapsulation if we are expecting an
+ // empty encapsulation.
+ i += sz - sizeof(Ice::Int) - 2;
+ }
return encoding;
}