summaryrefslogtreecommitdiff
path: root/csharp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2016-04-26 09:00:57 +0200
committerBenoit Foucher <benoit@zeroc.com>2016-04-26 09:00:57 +0200
commitc2ce37b7b0f6fc033cac4d52d460ee2f389d7737 (patch)
treedab204bc1dfd9298c7acb13b9493a210f8c4e978 /csharp/src
parentAdd jquery-cookie to bower dependency (diff)
downloadice-c2ce37b7b0f6fc033cac4d52d460ee2f389d7737.tar.bz2
ice-c2ce37b7b0f6fc033cac4d52d460ee2f389d7737.tar.xz
ice-c2ce37b7b0f6fc033cac4d52d460ee2f389d7737.zip
Fixed ICE-7115 - unmarshalling bug with optional parameters
Diffstat (limited to 'csharp/src')
-rw-r--r--csharp/src/Ice/BasicStream.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/csharp/src/Ice/BasicStream.cs b/csharp/src/Ice/BasicStream.cs
index cb36056533d..ab73ab83374 100644
--- a/csharp/src/Ice/BasicStream.cs
+++ b/csharp/src/Ice/BasicStream.cs
@@ -460,13 +460,30 @@ namespace IceInternal
public Ice.EncodingVersion skipEmptyEncaps()
{
int sz = readInt();
- if(sz != 6)
+ if(sz < 6)
{
throw new Ice.EncapsulationException();
}
+ if(sz - 4 > _buf.b.remaining())
+ {
+ throw new Ice.UnmarshalOutOfBoundsException();
+ }
Ice.EncodingVersion encoding = new Ice.EncodingVersion();
encoding.read__(this);
+ if(encoding.Equals(Ice.Util.Encoding_1_0))
+ {
+ if(sz != 6)
+ {
+ throw new Ice.EncapsulationException();
+ }
+ }
+ else
+ {
+ // Skip the optional content of the encapsulation if we are expecting an
+ // empty encapsulation.
+ _buf.b.position(_buf.b.position() + sz - 6);
+ }
return encoding;
}
@@ -4380,7 +4397,7 @@ namespace IceInternal
if(_current.sliceType == SliceType.ObjectSlice)
{
throw new Ice.NoObjectFactoryException("no object factory found and compact format prevents " +
- "slicing (the sender should use the sliced format " +
+ "slicing (the sender should use the sliced format " +
"instead)", _current.typeId);
}
else